What is locate command used for in Linux?
Experience Level: Junior
Tags: Linux
Answer
The locate command is used to find the files by name. There is two most widely used file searching utilities accessible to users are called find and locate. The locate utility works better and faster than find command counterpart because instead of searching the file system when a file search is initiated, it would look through a database. This database contains bits and parts of files and their corresponding paths on your system. By default, locate command does not check whether the files found in the database still exist and it never reports files created after the most recent update of the relevant database.
Related Linux job interview questions
What is grep command used for in Linux?
Linux JuniorWhat is find command used for in Linux?
Linux JuniorWhat is touch command used for in Linux?
Linux JuniorWhat is rm command used for in Linux?
Linux JuniorWhat is rmdir command used for in Linux?
Linux Junior