Re: Unix epoch changed?

From: Riccardo Torrini <riccardo_at_torrini.org>
Date: Mon, 14 Apr 2003 09:41:54 +0200
On Sun, Apr 13, 2003 at 02:29:48PM +0200, Jan Schlesner wrote:

>> Ok, I remember wrong.  But the question remain: why find -mtime -2
>> show a file from 1906 (near 100 year ago) instead of 2 days old?

> Try to use "-mtime 2" instead of "-mtime -2". ;-)
>                    ^                     ^^

It's not the same: positive_2 match file that are exactly 2 day old
but where negative_2 match file old from 0 upto 2 day.  I need the
second  :-(  And is documented, not a my invention...

# man find
[...]
Any number of units may be combined in one -atime argument, for
example, ``-atime -1h30m''.  Units are probably only useful when
used in conjunction with the + or - modifier.
[...]


# find /usr/ports/distfiles -mtime 20 -exec ls -land {} \; | \
	sed 's/^..........[ 0-9]* //'
Mar 25 11:10 /usr/ports/distfiles/gnome2
Mar 25 11:10 /usr/ports/distfiles/gnome2/docs
Mar 25 11:08 /usr/ports/distfiles/xc
Mar 25 11:10 /usr/ports/distfiles/KDE

# find /usr/ports/distfiles -mtime -20 -exec ls -land {} \; | \
	sed 's/^..........[ 0-9]* //'
Apr  4 14:40 /usr/ports/distfiles
Mar 25 11:10 /usr/ports/distfiles/gnome2
Mar 25 11:10 /usr/ports/distfiles/gnome2/docs
Apr  7 14:30 /usr/ports/distfiles/bdb
Apr  4 14:31 /usr/ports/distfiles/vim
Mar 25 11:08 /usr/ports/distfiles/xc
Dec 21  1909 /usr/ports/distfiles/xc/X336src-2.tgz
Dec 21  1909 /usr/ports/distfiles/xc/X336src-1.tgz
Mar 25 11:10 /usr/ports/distfiles/KDE
Dec 12  1909 /usr/ports/distfiles/mirrormagic-1.3.tar.gz

# find /usr/ports/distfiles -mtime 21 -exec ls -land {} \; | \
	sed 's/^..........[ 0-9]* //'
[...empty list...]

# find /usr/ports/distfiles -mtime -21 -exec ls -land {} \; | \
	sed 's/^..........[ 0-9]* //'
Apr  4 14:40 /usr/ports/distfiles
Mar 25 11:10 /usr/ports/distfiles/gnome2
Mar 25 11:10 /usr/ports/distfiles/gnome2/docs
Apr  7 14:30 /usr/ports/distfiles/bdb
Apr  4 14:31 /usr/ports/distfiles/vim
Mar 25 11:08 /usr/ports/distfiles/xc
Dec 21  1909 /usr/ports/distfiles/xc/X336src-2.tgz
Dec 21  1909 /usr/ports/distfiles/xc/X336src-1.tgz
Mar 25 11:10 /usr/ports/distfiles/KDE
Dec 12  1909 /usr/ports/distfiles/mirrormagic-1.3.tar.gz


-- 
Riccardo.
Received on Sun Apr 13 2003 - 22:42:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:03 UTC