· df · 1 min read

Unix Search - Search for a keyword in all the files

Unix findDeep searchUnix Search keyworddeep findTechnology

I know everyone knows how to search for a file or directory in Unix.

Have you encountered a major issue and wanted to search for a keyword? Its like finding needle in a haystack. Believe me its very simple in Unix and *nix servers.  Let me call it as “Deep Search” !!

Please find the simple command

# This will search all the .log files for keyword “test”
# .  will mean all directories under the pwd. Change “.” to “/” to search whole of the system. But remember to redirect errors
find . -name “
.log” -exec grep -l “test” {} ;