From owner-freebsd-questions@FreeBSD.ORG Mon Jun 6 14:16:39 2005 Return-Path: X-Original-To: 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 E36A216A41C for ; Mon, 6 Jun 2005 14:16:39 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id CBA6343D48 for ; Mon, 6 Jun 2005 14:16:38 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j56EGZer053988; Mon, 6 Jun 2005 09:16:35 -0500 (CDT) (envelope-from dan) Date: Mon, 6 Jun 2005 09:16:35 -0500 From: Dan Nelson To: Jerry McAllister Message-ID: <20050606141635.GK255@dan.emsphone.com> References: <20050606095343.D86876@zoraida.natserv.net> <200506061401.j56E1gJ4019888@clunix.cl.msu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506061401.j56E1gJ4019888@clunix.cl.msu.edu> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.9i Cc: FreeBSD Questions List Subject: Re: Looking for files older than n number of days? 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, 06 Jun 2005 14:16:40 -0000 In the last episode (Jun 06), Jerry McAllister said: > > I think I found a bug in find. > > If you add the '-ls' parameter before the -mtime it ignores mtime. > > Example: > > find . -ls -mtime -5d > > Shows all files in directory. > > > > find . -mtime -5d -ls > > Shows correctly files modified less than 5 days old. > > I am not sure it is exactly a bug. It seems to be dependant on how > find processes its parameters - in order of occurance. A similar > effect can be seen with some other parameter combinations such as > putting -print in the wrong place - you can get all files in the > system printed or none rather than just what you want. Possibly the > man page needs to be updated to make the effect of parameter order > clear. Correct. Each primary returns 'true' or 'false', and the first 'false' primary causes process to end for that file. OPERATORS The primaries may be combined using the following operators. The operators are listed in order of decreasing precedence. [...] expression -and expression expression expression The -and operator is the logical AND operator. As it is implied by the juxtaposition of two expressions it does not have to be specified. The expression evaluates to true if both expressions are true. The second expression is not evaluated if the first expression is false. -- Dan Nelson dnelson@allantgroup.com