find

grep in find command: how to display file names

Thursday, February 23rd, 2006

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 \;

Find the files not in use in Unix

Friday, February 10th, 2006

find . -name “*” -exec /usr/sbin/fuser {} 2>&1 \; | grep ‘: *$’

Keep on coding