Search for a text string in a directory or file with grep

To search for a string in a file or all files in a directory, you can use the grep command: grep “Some text to match here” /etc/* To search recursively in all directories underneath, you can use the -d recurse switch eg; grep -d recurse "some text to match here" /etc/ The above example would look for the the text some text to match here in all files present in /etc directory and its sub directories For more info, look at the man page for grep