The find command in Linux — finds the file name

1. Find the elm.cc file in a directory

find /home/lijiajia/ -name elm.cc

 

2. Find the file whose name contains a character, such as “ELM”

find /home/lijiajia/ -name ‘*elm*’

find /home/lijiajia/ -name ‘elm*’

find /home/lijiajia/ -name ‘*elm’

 

3. Query files based on their characteristics

Find /home/lijiajia/-amin-10 # Find files accessed in the last 10 minutes of the system

Find /home/lijiajia/-atime-2 # Find files accessed in the last 48 hours on the system

Find /home/lijiajia/-empty # Find a file or folder that is empty on the system

Find /home/lijiajia/-group cat # find /home/lijiajia/-group cat #

Find /home/lijiajia/-mmin-5 # Find files that have been modified in the last 5 minutes of the system

Find /home/lijiajia/-mtime-1 # Find files that were modified in the last 24 hours on the system

Find /home/lijiajia/-nouser # find the files on the system that belong to the invalid user.

Find /home/lijiajia/-amin 10 # Find files accessed in the last 10 minutes of the system

Find /home/ftp/pub-user lijiajia # Find files in the system that belong to the user lijiajia

(PS: all the above operations are in /home/lijiajia/ folder)

 

4. Use the mixed search mode to search for files

Find/tmp-size +10000000c -and -mtime +2 # Find a file in/TMP that is larger than 10000000 bytes and has been modified within 48 hours

Find/tmp-user tom-or-user George # find/TMP tom-or-user George

find /tmp ! -usr Fred # Find files in/TMP that do not belong to Fred

 

5. Search for and display files

Cc ‘-ls # find /home/lijiajia/-name ‘elm.cc’ -ls #