Upadate DataBase for locate Command using updatedb Command
Update database for locate command with updatedb command
The updatedb command is use to update the database entry that use by locate command to search faster for files or folder in Linux system. The database usually automatically updated daily by cron. The example below show the use of updatedb command manually.
Example:
Type in the updatedb command on the terminal and then hit the Enter key.. wait for few second..

[root@fedora ~]# updatedb
[root@fedora ~]#
Default updatedb configuration file locate under:
/etc/updatedb.conf
[root@fedora ~]# cat /etc/updatedb.conf
PRUNE_BIND_MOUNTS = "yes"
PRUNEFS = "auto afs gfs gfs2 iso9660 sfs udf"
PRUNEPATHS = "/afs /media /net /sfs /tmp /udev /var/spool/cups /var/spool/squid /var/tmp"
[root@fedora ~]#
The default locate database update by updatedb command:
/var/lib/mlocate/mlocate.db
The setting for updatedb command on crond to update the locate database daily:
[root@fedora ~]# cat /etc/cron.daily/mlocate.cron
#!/bin/sh
nodevs=$(< /proc/filesystems awk '$1 == "nodev" { print $2 }')
renice +19 -p $$ >/dev/null 2>&1
ionice -c2 -n7 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "$nodevs"
[root@fedora ~]#
Note: The command above tested on Fedora 9.
Keywords: update locate database, updatedb command, update database command, locate command database, locate database, update database locate
- Add new comment
- 9799 reads
- Email this page
Thanks for Reading and Check Other Popular Linux Topics
All time:
- Configure and Setup Squid Cache Proxy Server on Fedora Core.
- Using Linux rm command to delete, remove hidden files and folder - Basic Linux Command.
- Copy Linux Files and Copy Directory Using cp Command - Linux Basic Command.
- Moving or rename files and directory using Linux mv command - Basic Linux Command.
- Add, view, edit and configure route and static route on Linux Fedora Core - Linux Server Configuration.
- Get and display the size of file and directory in Linux system using du command.
- Step by step Install Setup and Configure Linux Fedora Core Server and Network Management with Screen Shot and Example.
- Create file and display file contents in Linux using cat command.
- Configure Squid to block HTTP request to specific web sites.
- Example of samba smbpasswd file and samba smbusers configuration file.

1 comment
basic unix commands
Submitted by eosiemo (not verified) on Thu, 11/18/2010 - 12:57.updating data base command