Unable to find files which have been in the folder one minute in Mac's Zsh
Question
I need to find files which have been in the folder Wastebasket exactly one minute. The files have been moved all over my computer to the folder.
I run the following unsuccessfully
find -atime n1m .
I get all my files in the directory by the command, even ones which I just created. It seems that the option -atime is not correct.
How can you find files which access time is one minute?
Solution
I think you're looking for
find -amin 1
n
is just a variable that you replace with a number.
+n
eg +1
means greater
n
eg 1
means exactly
-n
eg -1
means less than
OTHER TIPS
Drop the n
. The n
in the manpage stands for a number.
find -atime 1m .
Since you've mentioned you're using zsh, I might as well suggest a zsh-specific answer. To find all files with access time of minute or less ago, you can use the command:
$> ls *(.am-1)