I have written several articles on commonly used Linux commands and components intermittently. Readers who often come to the VPS blog should be used to this wild and unconstrained recording method. I just record whatever comes to my mind, and I record whatever I am afraid of forgetting. Today I suddenly want to record it. Here are some simple ways to use the find command under Linux.
In the Windows system, we can directly click Search to find the files and folders we want, but Linux is not so convenient. The command to find files under Linux is generally find. Its usage is also very broad. I only record some simple ones here for easy search. They are just for novices like me and can be bypassed by heroes.

Incomplete file names are also partial file names. For example, we know that there is a conf file with a name starting with wp and we want to find it.

[[email protected] /]# find / -name ‘wp*.conf’
/usr/local/nginx/conf/wp2.conf

With the above command, we can also easily find this file. Please note that if we know that the file name only contains the two letters wp and does not start with wp, it can be written as *wp*.

There are many ways to use the find command. It is beneficial for everyone to be familiar with its operation methods. I will list some here.

find / -amin -10 # Find files accessed in the last 10 minutes in the system
find / -atime -2 # Find files accessed in the last 48 hours in the system
find / -empty # Find files accessed in the system for the last 48 hours Empty files or folders
find / -group cat # Find files belonging to groupcat in the system
find / -mmin -5 # Find files that have been modified in the last 5 minutes in the system
find / -mtime -1 #Find files modified in the last 24 hours in the system
find / -nouser #Find files belonging to invalid users in the system
find / -user fred #Find files belonging to FRED in the system User's files

There are also some that are too advanced, and the total number of commands is too long to read. I don’t know how to use them, and I don’t bother to memorize them. If necessary, you can use a search engine to find them.


Hong Kong/United States/Domestic High Speed ​​VPS

Tags: linux command, Linux common command, find

window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":["mshare","kaixin001","tsina"," tsohu","tqq","renren","qzone","weixin","bdysc","bdxc","tqf","tieba","douban","bdhome","sqq","thx" ],"bdPic":"","bdStyle":"0","bdSize":"24"},"slide":{"type":"slide","bdImg":"2","bdPos" :"left","bdTop":"100"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["tsina","tqq","tsohu","qzone","renren", "weixin","mshare"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg .share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
postid
18098

Leave a Reply