how to search a string in a directory using grep code example Example: grep search for string in directory grep -nr 'yourString*' .