【问题标题】:list only last 24 hours created files in unix仅列出过去 24 小时在 unix 中创建的文件
【发布时间】:2018-09-12 08:34:24
【问题描述】:

我想显示 24 小时前创建的文件,但下面的命令给 2012,2013 年的文件也提供了任何建议。

**sdtt02 [c_t2] 406: find /users/c_t2/ws/ -maxdepth 1 ! -name 'ws' ! -name 'binaries' ! -name 'delivery' ! -name 'cause' -ctime 1**
/users/c_t2/ws/Rlinp53.nic
/users/c_t2/ws/Rlinp55.nic
/users/c_t2/ws/new.sh
/users/c_t2/ws/file
/users/c_t2/ws/Rlinp53.nic%
/users/c_t2/ws/.linuxemuver.swp

sdtt02 [c_t2] 407: ls -lrt /users/c_t2/ws/Rlinp53.nic
-rwxr-xr-x 1 c_2 dhs3 89 Oct 22  2007 /users/c_t2/ws/Rlinp53.nic
sdtt02 [c_t2] 408: ls -lrt /users/c_t2/ws/Rlinp55.nic
-rwxr-xr-x 1 c_t2 dhs3 70 Apr 22  2008 /users/c_t2/ws/Rlinp55.nic

【问题讨论】:

    标签: unix find unix-timestamp ctime


    【解决方案1】:

    要查找过去 24 小时内在特定特定目录及其子目录中创建的所有文件:

    find /users/c_t2/ws/ -ctime -1 -ls
    

    如果要查找所有修改过的文件:

    find /users/c_t2/ws/ -mtime -1 -ls
    

    【讨论】:

      猜你喜欢
      • 2020-01-14
      • 1970-01-01
      • 2012-10-30
      • 1970-01-01
      • 2016-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多