Find Any File 2 1 11
Windows 10 tip: Search for any file by date. Finding the right file can be frustrating, especially if you have a large number of files in multiple subfolders.
- Linux: Finding and Locating files with find command part # 1; Linux / UNIX: Finding and locating files with find command part # 2; Linux or Unix find and remove files with one find command on fly; Find and Delete File If It Is More Than One Hour Old in UNIX Shell; Find command man page.
- I got a shell script like this. Cat file1.dat 2 file2.log Can somebody explain what does mean. I searched a lot but didnt find anything.I have checked this one cat documentation.But didnt find this 2.I am a total newbie in shell script.Any help is appreciated.
To use the find
command, at the Unix prompt, enter:
Replace 'pattern'
with a filename or matching expression, such as '*.txt'
. (Leave the double quotes in.)
Options
The general form of the command is:
The find
command will begin looking in the starting directory you specify and proceed to search through all accessible subdirectories. You may specify more than one starting directory for searching.
You have several options for matching criteria:
-atime n | File was accessed n days ago |
-mtime n | File was modified n days ago |
-size n | |
-type c | Specifies file type: f=plain text, d=directory |
-fstype typ | |
-name nam | The filename is nam |
-user usr | The file's owner is usr |
-group grp | The file's group owner is grp |
-perm p | The file's access mode is p (where p is an integer) |
You can use +
(plus) and -
(minus) modifiers with the atime
, mtime
, and size
criteria to increase their usefulness, for example:
-mtime +7 | |
-atime -2 | Matches files accessed less than two days ago |
-size +100 |
By default, multiple options are joined by 'and'. You may specify 'or' with the -o
flag and the use of grouped parentheses. To match all files modified more than 7 days ago and accessed more than 30 days ago, use:
To match all files modified more than 7 days ago or accessed more than 30 days ago, use:
You may specify 'not' with an exclamation point. To match all files ending in .txt
except the file notme.txt
, use:
Find Any File 2 1 111
You can specify the following actions for the list of files that the find
command locates:
-print | |
-exec cmd | Execute command cmd on a file. |
-ok cmd | Prompt before executing the command cmd on a file. |
-mount | (System V) Restrict to file system of starting directory. |
-xdev | (BSD) Restrict to file system of starting directory. |
-prune |
Executed commands must end with ;
(a backslash and semi-colon) and may use {}
(curly braces) as a placeholder for each file that the find
command locates. For example, for a long listing of each file found, use:
Matching criteria and actions may appear in any order and are evaluated from left to right.
Full examples
- To find and report all C language source code files starting at the current directory, enter:
- To report all files starting in the directories
/mydir1
and/mydir2
larger than 2,000 blocks (about 1,000KB) and that have not been accessed in over 30 days, enter: - To remove (with prompting) all files starting in the
/mydir
directory that have not been accessed in over 100 days, enter: - To show a long listing starting in
/mydir
of files not modified in over 20 days or not accessed in over 40 days, enter: - To list and remove all regular files named
core
starting in the directory/prog
that are larger than 500KB, enter:On some systems, the name of the starting directory must end with a/
(slash), or thefind
command will return nothing. Thus, the starting directory in the previous example would be designated as/prog/
, with a trailing slash. On other systems, a trailing slash does not affect the command. A trailing slash is never needed when searching in/
(the root directory),.
(the current directory), or..
(the parent directory).
Find Any File 2 1 11 0
For more, consult the Unix manual page by entering at the Unix prompt:
Find Any File 2 1 11 Free
Find Any File 2 1 11 Numerology
Some of the above information came from Essential SystemAdministration, Aeleen Frisch (O'Reilly & Associates, Inc., 1991).
At Indiana University, for personal or departmental Linux or Unix systems support, see Get help for Linux or Unix at IU.