The usage format of the find command under Linux: [find [find directory] [find rules]]. We can search for files by file name, such as [find /etc -name "*.conf"], which means finding files ending with [.conf] in the etc directory.
find command
(recommended learning: linux tutorial)
find command usage format :
find [指定查找目录] [查找规则] [查找完后执行的action]
Note: Directories must be separated by spaces.
Search rules:
(1) Search based on the file name
# -name //根据文件名查找(精确查找) # -iname //根据文件名查找,但是不区分大小写
find /etc -uname [c,d]*f
# -user //根据属主来查找文件 # -group //根据属组来查找文件
#find /tmp -uid 500 //查找uid是500 的文件 #find /tmp -gid 500// 查找gid是1000的文件
The above is the detailed content of How to use find command under linux. For more information, please follow other related articles on the PHP Chinese website!