[英]How to list files that are not accessed for particular mins or days using linux find command?
I created a file t3 under /praveen/sf and used below command to find the files that are not accessed (i am actually looking for t3 file)我在 /praveen/sf 下创建了一个文件 t3 并使用下面的命令来查找未访问的文件(我实际上是在寻找 t3 文件)
$ find praveen -atime +1 -exec grep -iw -r 'vpc' {} \;
But I did not get any output, so I used below command但是我没有得到任何 output,所以我使用了以下命令
$ find praveen -atime -1 -exec grep -iw -r 'vpc' {} \;
praveen/sf/t3:NACL referes to Network Access Control Lists, which is actually a security layer of our Virtual Private Cloud (VPC).
praveen/sf/t3:NACL referes to Network Access Control Lists, which is actually a security layer of our Virtual Private Cloud (VPC).
NACL referes to Network Access Control Lists, which is actually a security layer of our Virtual Private Cloud (VPC).
And I read like -atime -1
displays files which are accessed by more than 1 day ago and -atime +1
displays files which are not accessed 1 day ago.我读到
-atime -1
显示超过 1 天前访问的文件,而-atime +1
显示 1 天前未访问的文件。
But the above commands did not throw output as I had read.但是上面的命令并没有像我读过的那样抛出 output 。
Please help.请帮忙。
Your understanding of find
's -atime
usage is not correct.您对
find
的-atime
用法的理解不正确。 -atime -1
displays files which were last accessed less than 1 day (24 hours) ago, and -atime +1
displays files which were last accessed more than 24 hours ago. -atime -1
显示最后一次访问不到 1 天(24 小时)前的文件, -atime +1
显示最后一次访问超过 24 小时前的文件。 To see files NOT accessed within the last 24 hours in the current dir, you can run this find
command:要查看当前目录中过去 24 小时内未访问的文件,可以运行以下
find
命令:
find . -type f -atime +1 | xargs ls -ld
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.