Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2002 14:46:58 +1100
From:      Greg Lane <gregory.lane@anu.edu.au>
To:        Sean Chittenden <sean@chittenden.org>
Cc:        Posthuman <posthuman@sbcglobal.net>, questions@FreeBSD.ORG
Subject:   Re: file in a system.
Message-ID:  <20020220144658.A51230@nucl03.anu.edu.au>
In-Reply-To: <20020219192852.F29935@ninja1.internal>; from sean@chittenden.org on Tue, Feb 19, 2002 at 07:28:52PM -0800
References:  <000c01c1b9ba$3d41e9b0$0abf7842@posthuman> <20020219192852.F29935@ninja1.internal>

next in thread | previous in thread | raw e-mail | index | archive | help
> > I've been browsing thru the man pages in order to locate "command +
> > arguments" on how I can locate a certain file in the system if am not
> > sure where it is. I stopped at "wc" "grep" "whereis" but I didn't get
> > any results. My question is how can I list all *.log files on my system
> > + the path for everyone, regardless of their location. If can give an
> > example I will be grateful. Thanks in advance.
> 
> locate '*.log'
> 
> Make sure you locatedb is up to date.  A weekly script gets run to
> keep the DB in sync, /etc/periodic/weekly/310.updatedb.  Feel free to
> run this whenever you feel your locate commands are no longer
> accurate.  -sc
> 

This is true except for one caveat. The locate command will not find 
ALL files in ALL paths as locate by default runs as user nobody and
only sees files in directories for which "nobody" has read access.

As root you can use:

find / -name "*.log"

to find every .log file and its full path.

Cheers,
Greg

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020220144658.A51230>