Linux command find command

In the Linux system can be used find command to find files, but also delete, find files specified date
format:
  find path [1 parameter value 1 Parameter 2 value 2]
-name parameter specifies the file name

# Find the name -name specify a query as something jdk file name under / usr / local directory 
the Find / usr / local - name jdk

# Find the current directory name to something .log end of 
the Find. -Name * .log      

# From the root directory name is server.py Find something 
find / -name server.py  


-mtime modified +3 to -3 on behalf of three days ago 3 days

# Find / modified 3 days before the stuff delete tmp directory under 
the Find / tmp -mtime +3 - the Delete

# Find .log end of the / tmp directory modified 3 days before the file is deleted 
the Find / tmp -name * .log -mtime +3 - the Delete

# Find .log end of the / tmp directory 3 days modified file deletion 
find / tmp -name * .log -mtime -3 -delete


-ctime Created +3 to -3 on behalf of three days ago 3 days

# Find .log end of the / tmp directory 3 days to create a file to delete 
the Find / tmp -name * .log -ctime -3 - the Delete

# Find .log end of the / tmp directory is created within 3 days of deleted files 
find / tmp -name * .log -ctime +3 -delete


-type f represents the file type of file folders on behalf of d l represents the link

# Finds log files in the / tmp directory folder created three days ago
find /tmp -name *log* -type d -ctime +3  

# Find / tmp directory created 10 days before ending in .jpg file to 
find / tmp -name * .jpg -type f   -ctime +10


-size size is less than 10K 10M 19G -10K greater than 10K 10K 10K +

# Find / tmp directory at the end of the 10M size .jpg files 
the Find / tmp -name * .jpg - size 10M

# Look inside the computer all the above documents larger than 20G 
find / -size + 20G -type f


-empty empty

# Empty file system to find and delete 
the Find / -empty The -type f - the Delete

# Empty file search system folder and delete the 
find / -empty -type d -delete


-o or that or the meaning of

# Find ending in .log files ending in .jpg or 
find / -name * .log -o -name * .jpg

 

Guess you like

Origin www.cnblogs.com/yttbk/p/11104395.html