Home  >  Article  >  php教程  >  find command

find command

高洛峰
高洛峰Original
2016-12-14 17:04:181214browse

The find command is used to find files in the specified directory. Any string preceding the parameter will be treated as the name of the directory to be searched. If you use this command without setting any parameters, the find command will search for subdirectories and files in the current directory. And all found subdirectories and files will be displayed.

Syntax

find(option)(parameter)

Options

-amin: Find files or directories that have been accessed at the specified time, in minutes;

-anewer: Find files or directories whose access time is closer to the current access time than the specified file or directory;

-atime<24 hours>: Find files that have been accessed at the specified time or Directory, the unit is calculated in 24 hours;

-cmin: Find files or directories that have been changed at the specified time;

-cnewer Find files or directories whose change time is later than the specified file or directory The change time of the directory is closer to the current file or directory;

-ctime<24 hours>: Find files or directories that were changed at the specified time, the unit is calculated in 24 hours;

-daystart: Starting from today Calculation time;

-depth: Start searching from the deepest subdirectory under the specified directory;

-expty: Find files with a file size of 0 Byte, or an empty directory without any subdirectories or files in the directory;

- exec: Assume that the return value of the find command is True, execute the command;

-false: Set all the return values ​​​​of the find command to False;

-fls: This The effect of the parameter is similar to that of specifying the "-ls" parameter, but the result will be saved as the specified list file;

-follow: Exclude symbolic links;

-fprint: The effect of this parameter is the same as that of specifying "- print" parameter is similar, but the result will be saved into the specified list file;

-fprint0: The effect of this parameter is similar to specifying the "-print0" parameter, but the result will be saved into the specified list file;

-fprintf: The effect of this parameter is similar to specifying the "-printf" parameter, but the result will be saved into the specified list file;

-fstype : Only search for files or directories under this file system type;

-gid: Search for files or directories that match the specified group ID;

-group: Search A file or directory that matches the specified group name;

-help or --help: online help; -ilname