[Next] [Previous] [Up] [Top] [Contents]

5.9 Miscellaneous useful commands

5.9.1 find command

find is used to search for files, matching a naming pattern, file type, permissions, date of last use, etc. It will search recursively through the directory tree. find can also execute commands based on the results, e.g.:

% find ~ -name src -print
/home/tardis/frank/src

Root's crontab file sometimes has an entry similar to the following:

30 3 * * * find / -name core -exec rm -f {} \; -o -fstype nfs -prune

This instructs the cron program to execute the find command at 3:30 am everyday. The find command searches every directory, except those on file systems of type "nfs", for files named "core" and removes them.


Unix System Administration - 8 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]