Locate Command in Ubuntu Linux: mLocate app is a command line utility which allows you to search and find files on your Ubuntu system. You can simply install the utility using the APT package installer. In this article, we will explain how to install mLocate command line utility app on your Ubuntu systems.
Install mLocate Utility:
You can install the locate command line utility using the below command!
- Copy the above command & execute it to initiate the installation process.
In a few seconds, the installation of mLocate utility will be completed.
Locate Command Options:
locate –h, the command will print all the available options in the terminal.
[email protected]:~$ locate --h Usage: locate [OPTION]... [PATTERN]... Search for entries in a mlocate database. -A, --all only print entries that match all patterns -b, --basename Match only the base name of pathnames -c, --count the only print number of found entries -d, --database DBPATH use DBPATH instead of default database (which is /var/lib/mlocate/mlocate.db) -e, --existing only print entries for currently existing files -L, --follow follow trailing symbolic links when checking file existence (default) -h, --help print this help -i, --ignore-case ignore case distinctions when matching patterns -p, --ignore-spaces ignore punctuation and spaces when matching patterns -t, --transliterate ignore accents using iconv transliteration when matching patterns -l, --limit, -n LIMIT limit output (or counting) to LIMIT entries -m, --mmap Ignored, for backward compatibility -P, --nofollow, -H don't follow trailing symbolic links when checking file existence -0, --null separate entries with NUL on output -S, --statistics don't search for entries, print statistics about each used database -q, --quiet report no error messages about reading databases -r, --regexp REGEXP search for basic regexp REGEXP instead of patterns --regex patterns are extended regexps -s, --stdio ignored, for backward compatibility -V, --version print version information -w, --wholename match whole path name (default) Report bugs to https://pagure.io/mlocate. [email protected]:~$
These are the available options of the command Locate in Ubuntu Linux.
How to use:
Using locate command in Linux is very easy! The basic syntax to find or locate the files in your system is,
If you want to locate the file using the filename and then use the following command,
If you want to display all the file having the same name and then use the below command,
- -5 : Number of files that want to show in the output.
Remove mLocate Command Utility:
You can remove the mLocate command by using a simple command,
Follow the proceedings and the mLocate command utility app will be removed from your Ubuntu Linux system.
That’s it. This is the wrap section of this article. Locate and find command are almost similar but both have some unique changes in their functions. If you have any queries related to this article and then kindly comment us below.