Eureka Moment Wiki

One eureka moment at the time

User Tools

Site Tools


linux:shell_commands:string_search

Search for files with specific text in them

|Linux shell
find /var/www -type f -exec grep -l '/sync-clients/' {} \;

This will output all files with the specified string. The path in example is /var/www, and string we search for is /sync-clients/

|Linux shell
grep -iRl 'text' .
  • -i > ignore caps
  • -R > recursive
  • -l > Display filename instead of text
  • 'text' > text to search
  • . > location to start in

Discussion

Enter your comment:
G G F M J
 
linux/shell_commands/string_search.txt · Last modified: 2019/05/22 14:12 by tplecko