# updatedb
It is a good idea to periodically run the updatebd command to keep your index current when you go to search for files. All you need to know to search for files is to know all or part of the file name. For example, if you couldn't remember where the xorg.conf file is saved, you can search for it like this:
$ locate xorg.conf
Here is an example output of the above command:
$ locate xorg.conf
/etc/X11/xorg.conf
/usr/share/man/man5/xorg.conf.5.gz
/var/lib/x11/xorg.conf.md5sum
/var/lib/x11/xorg.conf.roster
$
/etc/X11/xorg.conf
/usr/share/man/man5/xorg.conf.5.gz
/var/lib/x11/xorg.conf.md5sum
/var/lib/x11/xorg.conf.roster
$
Alternatively, if you were looking for the xorg.conf file, but could only remember that the filename started with xorg., you could search for it like the following:
$ locate /xorg.
/etc/X11/xorg.conf
/usr/share/X11/xkb/rules/xorg.lst
/usr/share/X11/xkb/rules/xorg.xml
/usr/share/man/man5/xorg.conf.5.gz
/var/lib/dpkg/info/xorg.list
/var/lib/dpkg/info/xorg.md5sums
/var/lib/x11/xorg.conf.md5sum
/var/lib/x11/xorg.conf.roster
$
/etc/X11/xorg.conf
/usr/share/X11/xkb/rules/xorg.lst
/usr/share/X11/xkb/rules/xorg.xml
/usr/share/man/man5/xorg.conf.5.gz
/var/lib/dpkg/info/xorg.list
/var/lib/dpkg/info/xorg.md5sums
/var/lib/x11/xorg.conf.md5sum
/var/lib/x11/xorg.conf.roster
$
There is more that can be done with the locate command, but this has covered about 98% of the times I've used it. I'll probably cover some more of these features in a later post. Another thing that is useful is to schedule the updatedb command via cron, which we'll be discussing next time.
See you next time
No comments:
Post a Comment