/ whereis file name
Find file tools
Whereis is a small and easy-to-use file search tool, which is dedicated to search for executable programs, original programs, and manuals.
For example, execute commands:
Whereis bzip2
It will tell you, Bzip2 is placed in / usr / bin. Usually, if you make sure something is a program, and if you can't find anything, then it means that the system is not installed, for example:
Whereis cjoe
Indicates that there is no CJOE in this system, otherwise it should be found. /// Looking for a file tool
Find is a high-level lookup file tool, not like whereis so "Yangchun Snow". But because it is too advanced, it is complex to many people in unprinted. We try to lift simple examples.
The simplest format is as follows:
Find / -name my * -print
This means to start looking for a file from the bottom of the main directory, finding the file name is the file starting with my, display it. The -print option is displayed, you can make it a fixed-to-add item.
But it can also use time to find, for example:
Find / usr -atime 3 -print
Will start from the / usr directory to find the files that have been accessible for the last 3 days.
Find / usr -ctime 5 -print
Will start from the / usr directory to find the files that have been modified within the last 5 days.
Find / doc -user jacky -name 'j *' -print
Will start from the / doc directory to find it, find Jacky, the file name starts is the file of J.
Find / doc / (-Name 'ja *' -o- -name 'ma *' /) -print
Will start from the / doc directory to find the file name is the file name of the JA start or MA.
Find / doc -name '* bak' -exec rm {} /;
Will start from the / doc directory to find it down, find the file that is ending the file name is BAK, delete it. The -exec option is the meaning of the execution, the RM is the delete command, {} represents the file name, "/;" is the end of the specified command.
/