Tag Archives: grep

grep as search function

use grep as search function

If you are looking for a file containing a certain string and want only the filenames as result, try:

grep -r -c theStringYouWantToFind * \
| grep -v :0

The first grep looks for your string theStringYouWantToFind in all files * and folders -r and returns how often -c the string has been found in each file.

The second grep shows only the files where the search result was higher then 0.

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!