From owner-freebsd-questions@FreeBSD.ORG Mon Jan 2 17:10:58 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FD9116A420 for ; Mon, 2 Jan 2006 17:10:58 +0000 (GMT) (envelope-from drew@mykitchentable.net) Received: from relay04.roc.ny.frontiernet.net (relay04.roc.ny.frontiernet.net [66.133.182.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2880843D4C for ; Mon, 2 Jan 2006 17:10:54 +0000 (GMT) (envelope-from drew@mykitchentable.net) Received: from filter09.roc.ny.frontiernet.net (filter09.roc.ny.frontiernet.net [66.133.183.76]) by relay04.roc.ny.frontiernet.net (Postfix) with ESMTP id 62A9635833C; Mon, 2 Jan 2006 17:10:47 +0000 (UTC) Received: from relay04.roc.ny.frontiernet.net ([66.133.182.167]) by filter09.roc.ny.frontiernet.net (filter09.roc.ny.frontiernet.net [66.133.183.76]) (amavisd-new, port 10024) with LMTP id 30512-07-23; Mon, 2 Jan 2006 17:10:47 +0000 (UTC) Received: from blacklamb.mykitchentable.net (67-51-143-222.dsl1.elk.ca.frontiernet.net [67.51.143.222]) by relay04.roc.ny.frontiernet.net (Postfix) with ESMTP id DCBED3581DA; Mon, 2 Jan 2006 17:10:46 +0000 (UTC) Received: from [192.168.1.3] (unknown [192.168.1.3]) by blacklamb.mykitchentable.net (Postfix) with ESMTP id 1C7D0AE946; Mon, 2 Jan 2006 09:10:30 -0800 (PST) Message-ID: <43B95E86.1020309@mykitchentable.net> Date: Mon, 02 Jan 2006 09:10:30 -0800 From: Drew Tomlinson User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Adam Nealis References: <20060102163519.78476.qmail@web86910.mail.ukl.yahoo.com> In-Reply-To: <20060102163519.78476.qmail@web86910.mail.ukl.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-2.3.2 (20050629) at filter09.roc.ny.frontiernet.net Cc: FreeBSD Questions Subject: Re: Find Syntax X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2006 17:10:58 -0000 On 1/2/2006 8:35 AM Adam Nealis said the following: >--- Drew Tomlinson 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 >> >>