根据上次访问时间在Linux中查找子目录

问题描述 投票:0回答:1

我如何找到最近2天访问过的给定目录的子目录?我会用

$ find /home/you/$thedirectory  -atime -2 -type -d  

上面的命令只会给我子目录吗?

linux directory
1个回答
0
投票

以下命令将用于查找最近给定(2)天内访问过的目录

find /home/dir  -type d -atime -2 

哪里,

  • 如果-atime的参数为正,例如:+2,则表示查找文件/目录早于2天访问]
  • 如果-atime的参数为负,例如:-2,则表示查找文件/目录2天内访问

注意:注意-type d -atime -2,以文件类型d开头的连字符(-)

有效类型参数是

          b      block (buffered) special

          c      character (unbuffered) special

          d      directory

          p      named pipe (FIFO)

          f      regular file

          l      symbolic link; this is never true if the -L option or the -follow option is in effect, unless the symbolic link is broken.  If you want to search for symbolic links when -L is in effect, use -xtype.

          s      socket

          D      door (Solaris)
© www.soinside.com 2019 - 2024. All rights reserved.