TA的每日心情 | 开心 2023-8-9 11:05 |
---|
|
-a-c-m得意义 - -atime n
- File was last accessed n*24 hours ago. When find figures out how many 24-hour periods ago the file was last accessed, any fractional part is ignored, so to match -atime +1, a file has to have been accessed at least two days ago.
- -ctime n
- File's status was last changed n*24 hours ago. See the comments for -atime to understand how rounding affects the interpretation of file status change times.
- -mtime n
- File’s data was last modified n*24 hours ago.See the comments for -atime to understand how rounding affects the interpretation of file modification times.
复制代码 n,+n,-n得意义
- 找“5天之内被更改过的档案名”find / -mtime -5
- 找“5天前的那一天被更改过的档案名”find / -mtime 5
- 找“5天之前被更改过的档案名”find / -mtime +5
复制代码 示例
find ./bdump -name *.trc -mtime +15 -exec rm -f {} \;
find /rman_backup/data -ctime 5 -exec rm {} \;
find /monitor/nmon/daily -mtime +120 -name "*.nmon" -exec rm -rf {} \;
find ./ -mtime -3 |xargs tar -zcvf ./osw_archives.tar.gz
|
|