locate PDF Print E-mail
Administrative Commands

locate

This command will locate a pattern in a database of filenames and will return the filenames that match. Example: locate .html The return would be all files with .html in the name. Here is an example with results when trying to locate all files with an .sh extension.

mike@ub:~$ locate .sh

/etc/default/initrd-tools.sh

/etc/init.d/procps.sh

/etc/init.d/checkroot.sh

/etc/init.d/checkfs.sh

/etc/init.d/mountnfs.sh

/etc/init.d/mountall.sh

---cut---

/var/lib/dpkg/info/e2fslibs.shlibs

/var/lib/dpkg/info/libcomerr2.shlibs

/var/lib/dpkg/info/libss2.shlibs

/var/lib/dpkg/info/libuuid1.shlibs

/var/lib/dpkg/info/libcap1.shlibs

/var/lib/dpkg/info/libdb1-compat.shlibs

/var/lib/dpkg/info/libdb3.shlibs

/var/lib/dpkg/info/libncurses5.shlibs

---cut---




Notice in the above example that the return includes files that have .shlibs.