Find command
Many Linux users like to use the Find command to find files, for example they usually like to do this:
Find/-name ' pattern '
The powerful feature of find is not only used to find files, it can be used to locate more detailed things, such as you want to find in a directory to give its owners and administrators can write permissions (if you wanted to find files which is writable by both T Heir owner and their group), you can do this:
Find/-perm-444-perm/222! -perm/111
Or you want to see the files that have been modified within the last 24 hours of your download directory,
find/home/user/downloads/-mtime 0
The power of the Find command is not just for finding files, it takes time to search for disks. So is there a quick way to locate it?
Locate command
before using locate, you have to verify that the system has mlocate packages installed, and most Linux distributions now have this package integrated. If it is not installed, you can access the Mlocate home page (http://carolina.mff.cuni.cz/~trmac/blog/mlocate/) to download the installation. After the download is successfully installed, you need to perform a command for your file system index. Otherwise you'll have to wait until the program is executed automatically.
The root user executes the following command:
UpdateDB &
This command will update your mlocate database in the background, which contains the index of your file system (this updates the Mlocate database that indexes your files and forks it to the BACKG Round (the ' & ' forks it to the background).
When this command is done, you can easily use the Locate command:
Locate Firefox | Less
This will quickly locate files, directories, and so on for Firefox. The speed is faster than find, because it reads the index inside the Mlocate database!
Linux uses the locate command to locate files