Thursday, February 12, 2009

The "find"

Many *nix users are familiar with the find tool, but not all of them knows its -exec parameter.

Assume you need to find specific function or set of string-lets say printf-among lots of c source
files, what you need to do is like:

$ find . -name "*" -exec grep -i printf {} \; -print

this process will look inside of every single file on current directory-yes binary ones included!-and list files that contains printf at least one time in very nice form.This kind of commands really help.

No comments:

Registred Linux User

Registred Linux User