grep string search code example Example 1: linux search for line in file grep -R "keyword" /directory/ Example 2: grep in folder grep -nr 'yourString*' .