|
||||
|
Using Find - the File Search ToolBy Joshua Erdman This page contains a description of how to search for files based on file name and age. The output can then be directed to a text file, the terminal screen, or a program. Command Syntaxfind [path...] [expression] Find will recursively search starting at the path you specify for files with a given name (using the -name flag) or days last modified (using the -mtime flag). There are plenty of other ways to filter through files so be sure to look through the man pages.
ExamplesExample: In this example we search through all files starting from the root looking for a file with the name sendmail.cf If the file is found, the file and path will be printed to the screen. find / -name sendmail.cf -print Example: In this case, no file is specified. We are searching in the current directory for all files that have been last modified 10 days ago or older. The output is then sent to the rm command to delete these files. find . -mtime +10 -exec rm '{}' \; Article last reviewed: 10/25/2006
|
Related Articles: |
||||||||