grep string in all files in directory code example Example 1: grep in all files grep -rni "string" * Example 2: grep search for string in directory grep -nr 'yourString*' .