web analytics
Skip to primary content
Skip to secondary content

MemoSoup

Mix of the things I always forget

MemoSoup

Main menu

  • Home
  • About
  • Links

Tag Archives: grep

grep in find command: how to display file names

Posted on 13/09/2009 by bigspoon
Reply

Here is very simple trick to force the grep command to display file name, when it’s used together with find operation.
Just write /dev/null as the “second file”

find . -type f -exec grep somestring {} /dev/null \;

Posted in Unix | Tagged filename, find, grep, unix | Leave a reply

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Proudly powered by WordPress