The operation of find file command find under linux

find /type -size +100M --find files larger than 100M in the type directory, /type means in the type directory;

find . -size -10k --find files less than 10k in the current directory, which is represented by . in the current directory;

find /etc -size +20k -a -size -50k --find files larger than 20k and less than 50k in the etc directory, -a indicates the condition when the and logic and two conditions are satisfied at the same time;

find /etc -size -20k -o -size +10M --find files smaller than 20k or larger than 10M in the etc directory, -o means OR logic or either of the two conditions can be returned;

 

find /etc -size +20k -a -size -50k -exec ls -lh {] \; --Find out all human-friendly files that are greater than 20k and less than 50k, and use the -exec command {} \; to execute Output the search results, the ls -lh command is a humanized output file, which is convenient for checking the size of the file. 

find /root -inum 262421 --find out the file whose root node number is 262421.

find /root -inum 262421 -exec rm -rf {} \; -- The command whose root node is 262421 can be deleted. 

find /root -iname install.log -- search by filename (case insensitive)

find /root -user root -- search according to the owner (the owner is root can be searched out);

find /root -nouser -- find files without an owner (usually this is often the case, because it can find junk files);

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326498933&siteId=291194637