The tribe recorded once in 2013 Find command The reason for this is that I found that a station was invaded and changed a lot of files Find command To find the files that have been modified in a certain period of time, so they can be picked up again for reference next time.
Find a file by file name
For example, we want to find a file in the system. The file name is a.php
find / -name a.php
The above/indicates the directory. If you know the directory, you can write to it to make the range smaller
Find files by incomplete file names
We can also find files by incomplete names. For example, we want to find all php files in the system, or know some two letters in the name of the php file.
Find/- name *. php # Find all php files Find/- name wp *. php # Find the php file whose file name starts with wp
Find by file characteristics
Here we take the file size search as an example, especially when we need to find large files
Find/- size 1500c # Find files with the size of 1500bytes Find/- size+1500c # Find files larger than 1500bytes Find/- size - 500c - size+50c # Find files larger than 50bytes but smaller than 500bytes
Find in other ways
For example, through time, through modification time, etc
Find/- amin - 10 # Find files accessed in the last 10 minutes in the system Find/- time - 2 # Find files accessed in the last 48 hours in the system Find/- empty # Find files or folders that are empty in the system Find/- group cat # Find files belonging to group cat in the system Find/- mmin - 5 # Find files modified in the last five minutes in the system Find/- mtime - 1 # Find files modified in the last 24 hours in the system Find/- nouser # Find files belonging to obsolete users in the system Find/- user fred # Find files belonging to the FRED user in the system Find/- mtime+3 # Find files changed 3 days ago Find/- name '*. php' - mtime - 3 # Find php files that have been changed within 3 days Find/- name 'wp *' - mtime 0 # Find files beginning with wp that have been modified within 24 hours
Statement: Blogs are only for sharing information and are not recommendations. Websites do not participate in transactions and are not intermediaries. The content only represents personal views and is not authoritative. Readers should consider it and take their own risks! Every penny and every commodity is still the eternal truth. Juvenile readers (including physical and psychological) should visit this website with their guardians! This article is written by( Zhao Rong )Original compilation, reprint, please keep the link: Linux common command find record The code is not easy, please do not copy or paste! About using: This website mainly shares server and VPS information, and does not provide any product sales or purchase. All visitors please purchase and use products within the scope of national laws and regulations. QQ group discussion: 683851361 About safety: Any IDC has the possibility of going bankrupt and running away. The host line is even more uncontrollable. Monthly payment and backup are your best choices. Please keep good and regular backup habits