Home  >  Article  >  Operation and Maintenance  >  Which folder does linux find a file in?

Which folder does linux find a file in?

angryTom
angryTomOriginal
2019-11-07 13:19:454269browse

Which folder does linux find a file in?

Which folder does Linux find files in?

You can use the find command to find files under Linux

For example:

find / -name tnsnames.ora

Found:

/opt/app/oracle/product/10.2/network/admin/tnsnames.ora
/opt/app/oracle/product/10.2/network/admin/samples/tnsnames.ora

Error-free search technique:

"find" in Linux system Commands are commands that can be used by most system users and are not exclusive to ROOT system administrators. However, ordinary users may also encounter such a problem when using the "find" command, that is, the system administrator ROOT in the Linux system can set certain file directories into access-denied mode. In this way, ordinary users do not have permission to use the "find" command to query these directories or files. When ordinary users use the "find" command to query these file directories, the words "Permissiondenied." (access prohibited) often appear. The system will not be able to query the file you want. In order to avoid such errors, we can use the method of transferring error prompts to try to find the file. For example, enter:

find / -name access_log 2>/dev/null

Search method based on part of the file name:

For example, if we know that a file contains the three letters srm, then it is possible to find all the files in the system that contain these three letters. Enter:

find /etc -name '*srm*'

According to File feature query method:

find / -amin -10 # 查找在系统中最后10分钟访问的文件 
find / -atime -2 # 查找在系统中最后48小时访问的文件 
find / -empty # 查找在系统中为空的文件或者文件夹 
find / -group cat # 查找在系统中属于groupcat的文件 
find / -mmin -5 # 查找在系统中最后5分钟里修改过的文件 
find / -mtime -1 #查找在系统中最后24小时里修改过的文件 
find / -nouser #查找在系统中属于作废用户的文件 
find / -user fred #查找在系统中属于FRED这个用户的文件

Recommendation: Linux system entry learning

The above is the detailed content of Which folder does linux find a file in?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn