If you can see this check that
| next section | prev section | up | prev page | next page |
When you work with many files, it can sometimes be difficult to remember where you have placed a file in the directory tree. The find command enables you to search through a directory and its subdirectories for files which meet a certain criteria. The command is flexible, in that it allows you to search by filename, owner, protection, size, date, or any combination. For example:
% find / -name myfile -printThe '/' is the name of the directory in which the command is to start searching, i.e. the root directory in this example. The '-name' option tells find the name of the file it is searching for. The '-print' option then echos to stdout the full path name of the file or files as they are found. You can include wildcards in your expression to describe a file name which contains certain characters. For example:
% find . -name 'my*' -printThe '.' specifies that the search should start from the current directory and proceed through any subdirectories. The 'my*' will find all files beginning with 'my', the expression has to be placed in single quotes so that the shell will interpret it correctly.
Here are some examples:
% find /home/john -newer myfile -printFind in the directory /home/john and its subdirectories any files that have been modified more recently that the file 'myfile' and echo to stdout.
% find / -user john -printFind all the files in the system belonging to the user 'john'.
% find . -name core -print -exec rm {} \;
Find all the files named core in the current directory and subdirectories. Ever time
a find is found, the command following the '-exec' is executed, in this case rm. Where
the braces {} appear in the command they are replaced by the name of the file.
The backslash-semicolon '\;' is required by find to terminate the -exec option.
Common options for the find command are:
| Linux tutorials: | intro1 intro2 wildcard permission pipe vi essential admin net fwall DNS diag Apache1 Apache2 MySQL1 MySQL2 |
| Caine 2.0: | Autopsy Cli PartRec Files FileRec Browser FFoxForensics Carving |
| Caine 2.5.1: | Essentials | Basic |
| Useful: | Quiz | Forums | Privacy Policy | Terms and Conditions |
| Site Links: | XMLZoo ActiveSQL ProgZoo SQLZoo |
Copyright @ 2004-2012 Gordon Russell. All rights reserved.