Friday 6 March 2015

Tips: Finding Files

find is a really useful tool for locating files, but it can be a bit slow. There is a command by the name locate that is much faster the super-useful find command, the reason being that locate command indexes files before-hand. The disadvantage is that files keep on getting added or removed making locate unreliable if the indexing is not done regularly.

First, index the files on your computer:

sudo updatedb
Then, search for a file:
locate -i <file>
I'd recommend putting updatedb in a cron to run regularly.

No comments:

Post a Comment