Use the Shell find command in detail.

Source: Internet
Author: User

 
Find
Search for files or directories.

Syntax: Find [directory...] [-Amin <minute>] [-anewer <reference file or directory>] [-atime <24 hours>] [-Cmin <minute>] [-cnewer <reference file or directory >] [-ctime <24 hours>] [-daystart] [-depyh] [-empty] [-exec <execution command>] [-false] [-FLS <list file >] [-follow] [-fprint <list File>] [-fprint0 <list File>] [-fprintf <list File> <output format>] [-fstype <File System type>] [-gid <group ID>] [-group <Group Name>] [-help] [-ilname <template style>] [-INAME <template style>] [-inum <inode No.>] [-ipath <template style>] [-iregex <template style>] [-Links <connection quantity>] [-lname <template style>] [-ls] [-maxdepth <directory level>] [-mindepth <directory level>] [-mmin <minute>] [-mount]
[-Mtime <24 hours>] [-name <template style>] [-newer <reference file or directory>] [-nogroup] [noleaf] [-nouser] [-OK <execution command>] [-path <template style>] [-Perm <permission value>] [-print] [-print0] [-printf <output format>] [-prune] [-RegEx <template style>] [-size <file size>] [-True] [-type <file type>] [-UID <user identification code>] [-used <days>] [-user <owner name>] [-Version] [-xdev] [-xtype <file type>]

Note: The find command is used to find files that meet the conditions. Any string located before the parameter will be considered as the directory to be searched.

Parameters:
-Amin <minute> searches for files or directories that have been accessed at a specified time, measured in minutes.
-Anewer <reference file or directory>: the access time is closer to the current file or directory than that of the specified file or directory.
-Atime <24 hours> searches for files or directories that have been accessed at a specified time. The unit is 24 hours.
-Cmin <min> searches for the files or directories changed at the specified time.
-Cnewer <reference file or directory>: the modification time is closer to the current file or directory than that of the specified file or directory.
-Ctime <24 hours> searches for the files or directories changed at the specified time. The unit is 24 hours.
-Daystart starts from the current day.
-Depth: searches for the deepest subdirectories in the specified directory.
-Expty is used to search for files with a file size of 0 bytes, or empty directories without subdirectories or files in the directory.
-Exec <execution command> If the return value of the find command is true, the command is executed.
-False: Set the return values of the find command to false.
-FLS <list File> the effect of this parameter is similar to that of the specified-ls parameter, but the result is saved as the specified list file.
-Follow: exclude symbolic connections.
-Fprint <list File> the effect of this parameter is similar to that of the specified "-print" parameter, but the result is saved as the specified list file.
-Fprint0 <list File> the effect of this parameter is similar to that of the specified "-print0" parameter, but the result is saved as the specified list file.
-Fprintf <list File> <output format> the effect of this parameter is similar to that of the specified "-printf" parameter, but the result is saved as a specified list file.
-Fstype <file system type> only searches for files or directories under the file system type.
-Gid <group ID> searches for files or directories that match the specified group ID.
-Group <Group Name>: Find the files or directories that match the specified group name.
-Help or -- Help Online Help.
-Ilname <template style> the effect of this parameter is similar to that of the specified "-lname" parameter, but the case sensitivity difference is ignored.
-INAME <template style> the effect of this parameter is similar to that of the specified "-name" parameter, but the case sensitivity difference is ignored.
-Inum <inode number> searches for files or directories that match the specified inode number.
-Ipath <template style> the effect of this parameter is similar to that of the specified "-ipath" parameter, but the case sensitivity difference is ignored.
-Iregex <template style> the effect of this parameter is similar to that of the specified "-regexe" parameter, but the case sensitivity difference is ignored.
-Links <connection count> searches for files or directories that match the specified number of hard connections.
-INAME <template style> specifies the string as the template style for searching for symbolic connections.
-Ls: If the return value of the find command is true, the file or directory name is listed to the standard output.
-Maxdepth <directory level> sets the maximum directory level.
-Mindepth <directory level> sets the minimum directory level.
-Mmin <minute> searches for files or directories that have been changed at a specified time, measured in minutes.
-Mount this parameter has the same effect as the specified "-xdev" parameter.
-Mtime <24 hours> searches for files or directories that have been changed at the specified time. The unit is 24 hours.
-Name <template style> specifies the string as the template style for searching for files or directories.
-Newer <reference file or directory> finds that the change time is closer to the current file or directory than that of the specified file or directory.
-Nogroup: Find a file or directory that does not belong to the local host group ID.
-Noleaf does not consider that the directory must have at least two hard connections.
-Nouser: Find a file or directory that does not belong to the user identification code of the local host.
-OK <execution command> the effect of this parameter is similar to that of the specified "-exec" parameter. However, you will be asked before executing the command. If you answer "y" or "Y ", then, the execution of the command is abandoned.
-Path <template style> specifies the string as the template style for searching for directories.
-Perm <permission value> searches for files or directories that match the specified permission value.
-Print: If the return value of the find command is true, the file or directory name is listed to the standard output. The format is one name for each column. Each name must have a "./" string before it.
-Print0: If the return value of the find command is true, the file or directory name is listed to the standard output. All names are in the same row.
-Printf <output format> If the return value of the find command is true, the file or directory name is listed in the standard output. You can specify the format.
-Prune does not search for strings as a template style for finding files or directories.
-RegEx <template style> specifies the string as the template style for searching for files or directories.
-Size <file size>: Find the files that match the specified file size.
-True: Set the return value of the find command to true.
-Typ <file type> only searches for files that match the specified file type.
-UID <user ID> searches for files or directories that match the specified user ID.
-Used <days> searches for files or directories that have been accessed at a specified time after the files or directories have been changed. The unit is calculated on a daily basis.
-User <owner name> searches for files or directories that match the specified owner name.
-Version or -- version: displays version information.
-Xdev limits the scope to the file system with the first line.
-Xtype <file type> the effect of this parameter is similar to that of the specified "-type" parameter. The difference is that it checks the symbolic connection.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.