Common commands for file search in Linux and Common commands for linux
File SEARCH Command: find
1. Search by file name
1.1. Search for precise files
Find path-name file name
1.2. Search for a file whose file name contains a string.
Find path-name * file name *
1.3. Search for files prefixed with a string.
Find path-name file name *
1.4. Search for files suffixed with a string.
Find path-name * file name
1.5. Search for the file name you want to match ,? Match any single character
Find path-name file name ???
1.6 search for files without case sensitivity
Find path-iname file name
2. Search by file size
Default size unit: data block: 1 data block = 512 bytes
2.1. Search for files larger than MB in the path
Find path-size + 204800
2.2. Search for files smaller than MB in the path
Find path:-size-204800
3. Search by owner
3.1. Search for all files of the owner in this path.
Find path-user Username
4. Search by group
4.1. Search for all the files in this group under this path.
Find path-group name
5. Search for files by Time
-Amin: access-cmin: file property (change): The property seen by ls-l-mmin: File Content (modify)
5.1. Search for the files and directories accessed in the path within five minutes.
Find path-amin-5
5.2. Search for the files and directories in the path that have been modified within 5 minutes.
Find path-cmin-5
5.3. Search for the files and directories in the path that have been modified within 5 minutes.
Find path-mmin-5
6. find connection options
-A: two conditions are met at the same time-o: either of the two conditions can be met.
6.1. Search for files larger than 80 m and smaller than m
Find path-size + 163840-a-size-204800
6.2 search for the inittab file in the path and display its details
Find path-name inittab-exec ls-l {}\;
VII. Others
7.1.-type search by file type
F File d directory l soft link file
Only find the file with the corresponding file name
Find path-name file name-a-type f
7.2-inum search by I Node
Find path-name file name-a-inum