小智 192
如果搜索dir是srch_dir那么无论
$ find srch_dir -cmin -60 # change time
Run Code Online (Sandbox Code Playgroud)
要么
$ find srch_dir -mmin -60 # modification time
Run Code Online (Sandbox Code Playgroud)
要么
$ find srch_dir -amin -60 # access time
Run Code Online (Sandbox Code Playgroud)
显示在过去一小时内创建,修改或访问的文件.
更正:ctime用于更改节点时间(不确定,请更正我)
eph*_*ent 23
UNIX文件系统(通常)不存储创建时间.相反,只有访问时间,(数据)修改时间和(inode)更改时间.
话虽如此,find有-atime -mtime -ctime谓词:
$ man 1 find ... -ctime n The primary shall evaluate as true if the time of last change of file status information subtracted from the initialization time, divided by 86400 (with any remainder discarded), is n. ...
因此find -ctime 0,不到一个小时前,查找inode已更改的所有内容(例如,包括文件创建,还计算链接计数和权限以及文件大小更改).
ayu*_*ush 10
看看这个链接,然后帮助自己.
基本代码是
#create a temp. file
echo "hi " > t.tmp
# set the file time to 2 hours ago
touch -t 200405121120 t.tmp
# then check for files
find /admin//dump -type f -newer t.tmp -print -exec ls -lt {} \; | pg
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
223120 次 |
| 最近记录: |