Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 706 Bytes

search-with-grep.md

File metadata and controls

25 lines (15 loc) · 706 Bytes

Search with grep

#unix #bash #grep #search #regex

Use grep to find strings in files. You can use regular expressions.

Find a literal string inside a directory

grep -rin "<string>" <directory>

  • -r is for recursive search.
  • -i means case insensitive.
  • -n outputs line numbers.

Note that you need to escape special characters inside your search string: \..

More information

Tools