unix - "find command -mtime 0" not getting the file i expect -
i trying find file 0 days old. below steps performed test this
$ ls $ ls -ltr total 0 $ touch tmp.txt $ ls -ltr total 0 -rw-r----- 1 tstuser tstuser 0 feb 28 20:02 tmp.txt $ find * -mtime 0 $ $ find * -mtime -1 tmp.txt $
why '-mtime 0' not getting me file?
what exact difference between '-mtime 0' , '-mtime -1'?
im sure there must other ways find files 0 days old in unix, im curious in understanding how '-mtime' works.
-mtime n file's data last modified n*24 hours ago. see comments -atime understand how rounding affects interpretation of file modification times.
so, -mtime 0 equal to: "file's data last modified 0 hours ago. while -mtime 1 be: "file's data last modified 24 hours ago"
edit:
numeric arguments can specified +n greater n, -n less n, n n.
so guess -1 modified within last 24 hours, while 1 1 day.
Comments
Post a Comment