Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of finding File location by linux

Shulou Source: shulou.com Published: 2022-06-02 21:56:58 09月22日 Update

In this issue, the editor will bring you the method of finding the location of files on linux. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

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 finding techniques:

In Linux systems, the "find" command is available to most system users and is not exclusive to ROOT system administrators. However, the average user can also encounter such a problem when using the "find" command, that is, the system administrator ROOT in the Linux system can set some file directories to disable access mode. In this way, ordinary users do not have the permission to query these directories or files with the "find" command. When the average user uses the "find" command to query these file directories, the words "Permissiondenied." (forbidden) often appear. The system will not be able to query the file you want. To avoid such errors, we can try to find the file by transferring the error prompt, such as typing:

Find /-name access_log 2 > / dev/null

Find the method based on some file names:

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

Find / etc-name'* srm*'

Query method according to the characteristics of the file:

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 empty files or folders in the system find /-groupcat # find files belonging to groupcat in the system find /-mmin-5 # find files 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 above is the way to find the location of files in linux shared by Xiaobian If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: File system command user method query general directory error location content letter hour that is administrator analysis management input specialty patent Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Redmi OPPO Reno macOS MySQL