{"id":165,"date":"2026-04-19T10:27:03","date_gmt":"2026-04-19T09:27:03","guid":{"rendered":"https:\/\/vpp.dk\/?linux_trick=search-inside-files-recursively"},"modified":"2026-04-19T10:27:03","modified_gmt":"2026-04-19T09:27:03","slug":"search-inside-files-recursively","status":"publish","type":"linux_trick","link":"https:\/\/vpp.dk\/?linux_trick=search-inside-files-recursively","title":{"rendered":"Search inside files recursively"},"content":{"rendered":"<p>Use grep to search through all files in a directory tree for a pattern, showing filenames and line numbers.<\/p>\n","protected":false},"template":"","meta":{"_trick_code":"grep -rn 'search_term' \/path\/to\/dir\/\n\n# Case-insensitive, show 2 lines of context:\ngrep -rin -C2 'error' \/var\/log\/","_trick_uploader":"tux42"},"trick_category":[16,19],"class_list":["post-165","linux_trick","type-linux_trick","status-publish","hentry","trick_category-file-management","trick_category-text-processing"],"_links":{"self":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=\/wp\/v2\/linux_trick\/165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=\/wp\/v2\/linux_trick"}],"about":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=\/wp\/v2\/types\/linux_trick"}],"wp:attachment":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165"}],"wp:term":[{"taxonomy":"trick_category","embeddable":true,"href":"https:\/\/vpp.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftrick_category&post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}