Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


Top White Papers

More on LinuxToday


How-To: Grep Tricks for Linux Users

Apr 29, 2010, 14:02 (0 Talkback[s])
(Other stories by Sandra Henry-Stocker)

"The first of these tricks allows you to create a list of files that contain whatever string you are looking for. It uses the -l (list just the file names, not the matched content) option plus the -r option for recursing through subdirectories. This can help you find files that you might be looking for without distracting you with all the reasons particular files matched your search criteria.

grep -rl "string you want to find" *

"Example:

$ grep -rl "meeting minutes" *
ARK2010/02-02-notes
ARK2010/TBD
Jan2010/TASkForce2
Mar2010/TaskForce2

Complete Story

Related Stories: