首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

linux rm 指定时间 资料

2012-07-15 
linux rm 指定时间 文件cd /tmp mkdir test_rm_spec cd test_rm_spec # 建立测试文件 touch -t 07102300 f

linux rm 指定时间 文件

cd /tmp
mkdir test_rm_spec
cd test_rm_spec

# 建立测试文件
touch -t 07102300 f1.txt
touch -t 07092300 f2.txt
touch f3.txt
mkdir fold1

# 查看文件
ls -l --time-style=long-iso

# 删除四天前的文件
find . -type f -mtime +4 -exe rm {} \;

# 查看文件
ls -l --time-style=long-iso

# 删除四天内的文件
find . -type f -mtime -4 -exe rm {} \;

# 查看文件
ls -l --time-style=long-iso

热点排行