linux find files find

Disclaimer: This article is a small Hu Zibo main original article, reproduced, please attach Bowen link! https://blog.csdn.net/woshaguayi/article/details/89480383
Find command file whatis   Also find the path from the man in
which   Find the path environment variable
File search locate   /var/lib/mlocate/mlocate.db by updating the database update
     

find

The default action is

-print  

 -Ls  

 -delete

-ok

 -exec command {} \;

-name Find -iname ignore case based on the file name
-size According to the size of files and directories to find the file, + 5M -5M Find by size -size
-user According to find whether the document belongs to the target user
-type Find (f, d, l) f files by file type d directory l link character device b block device c s p pipe socket file 

-atime、

-mtime、     -ctime

Press access, modify, create lookup time is greater than n + n, -n less than n, n is equal to n
-perm  644-755 Find by permission 
user -group  -nouser -nogroup Search by owner is a group

For xargs command does not support a pipeline and receive commands related to the output command such as rm, ls, etc.

find / -name "* .sh" | xargs -I test cp -rvf test / tmp test custom variables
find / -name "* .sh" -exec rm -rf {} \; command to expand
find / -name "* .sh "-exec rm -rf {} \ + command to merge

Guess you like

Origin blog.csdn.net/woshaguayi/article/details/89480383