Date: Mon, 02 Jan 2006 09:10:30 -0800 From: Drew Tomlinson <drew@mykitchentable.net> To: Adam Nealis <adamnealis@yahoo.co.uk> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: Find Syntax Message-ID: <43B95E86.1020309@mykitchentable.net> In-Reply-To: <20060102163519.78476.qmail@web86910.mail.ukl.yahoo.com> References: <20060102163519.78476.qmail@web86910.mail.ukl.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1/2/2006 8:35 AM Adam Nealis said the following: >--- Drew Tomlinson <drew@mykitchentable.net> wrote: > > > >>I'm trying to find all files with a modification time older than three >>weeks ago. In reading the find man page and searching Google, it seems >>the time returned by 'ls -l' is mtime. Thus I construct the following >>command: >> >>find . -not \( -newermt 3w \) -exec ls -l {} \; >> >> > >find has -ls as a built-in, so no need to do -exec ls -l {} \; > > Thanks. I tried it with '-ls' but the output wasn't formatted in a manner that was easy on my eyes. '-exec ls -l' keeps the date in the same column and is easier for me to scan as the output scrolls by. >I'm not sure what you mean by "-newermt" as a flag. Though "-newer mt" >would mean "newer than the file mt", in which case the "3w" part is not >appropriate. > > I interpreted the man page to mean the '-newermt' was files with a mtime that is "newer" than the time spec. Since what I really wanted was "older", I added the '-not'. >Do these do what you need to? > >find . -mtime +21 -ls > >or > >find -mtime +3w -ls > > Kind of. Please see my reply to Kevin Brunelle. Thanks, Drew >>But it returns files that are newer: >> >>-rw------- 1 nobody nobody 35292 Dec 29 08:43 totContactedRcvdPeers.rrd >>-rw------- 1 nobody nobody 35292 Dec 29 08:43 totContactedSentPeers.rrd >>-rw------- 1 nobody nobody 35292 Dec 29 08:33 >>./dc0/hosts/207/106/6/90/pktSent.rrd >> >>I've tried various placement of the '-not' and the )'s but I can't get >>it right. What am I missing? >> >>Thanks, >> >>Drew >> >>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43B95E86.1020309>