Sunday, September 12, 2010

How to locate file path in Linux

To use the locate command, you will need to have a slocate database set up on your system. On many systems it is updated periodically by the cron daemon.
For this you need to modify the file /etc/updatedb.conf. Change the DAILY_UPDATE=no to DAILY_UPDATE=yes

Try the slocate command to see if it will work on your system:

# locate whereis

Will list all files that contain the string "whereis". If that command did not work you will need to run the command:

# slocate -u

This command will build the slocate database which will allow you to use the locate command. This command will take a few minutes to run.

Now you will able to locate the file or directory in your server.

example - $ locate limits.conf
It will shows /etc/security/limits.conf

No comments:

Post a Comment

My Goals - AWS Certified Professional

My Goal - 19th Oct. 17 Diwali to 18th Oct. 18 Diwali # Weekly 10 hours Serious Study on new technology - AWS    Monthy 40 Hours   Yearly...