In linux, find, whereis, and locate files are mainly used.
Usually find is not very common. Hard drives are also very slow! Generally, we use whereis or locate to check whether it can be found. If it cannot be found, we use fin to search for it. Why? Because whereis does not use the database to search for data, it is quite fast, and there is no actual hard disk search, saving time!
The whereis command searches for qualified files in the specified directory. The attributes of the files should belong to the original code, binary files, or help files.
The locate command is used to find files that meet the conditions. It stores the files and directories in the database with the directory name and finds the files or directories that meet the conditions.
The use of locate is simpler. You can directly enter the "part name of the file" to obtain the result. (The locate command can quickly find the file when searching for the database. The database is updated by the updatedb program)
It is best to find.
Find is a very effective tool that can traverse the current directory or even the entire file system to Find some files or directories.
Find the file whose file name contains I
Find
-Name "I *. cpp"
Search for all files containing a word in Linux
Like grep hello/files-r-n, grep will output information similar to filenames: hello, not just knowing what the file name can know. -R is a subdirectory, and-n is a display file name. You can use grep -- help to see help. Many other parameters are available.