Re: get /full/path/filename.ext from filename.ext

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 2014-12-10, Dan Hyatt <dhyatt@xxxxxxxxxxxxxxxxx> wrote:
> I don't know if this is of interest as an alternative.

It may or may not be, but it doesn't help the OP, who already knows
where the file is, and just wants the full absolute path.  locate will
not help him there, especially if there are multiple files with the same
filename.ext on that filesystem.

> I did find a cool functionality called locate  and updatedb

locate has been around for many many years, certainly since at least
CentOS 4, likely much earlier.

> The problem is that it can get stale, but you can update it before doing 
> your searches.

There is (or at least, there should be) a script in /etc/cron.daily 
which updates it nightly.

> So if you need to do a set of searches on a filesystem (or whole system)
> run updatedb on each target filesystem to create the db for that filesystem.

You can configure locate (in /etc/updatedb.conf) with which directories
to index or not index.  Then you do not need to maintain your own
indexes, you can simply use the single system index.

--keith

-- 
kkeller@xxxxxxxxxxxxxxxxxxxxxxxxxx


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux