grep search for folder code example Example 1: grep in folder grep -nr 'yourString*' . Example 2: grep search for string in directory grep -nr 'yourString*' .