One - One Code All

Blog Content

使用shell脚本删除30天以前的文件

Linux-Mac 运维   2015-06-26 21:59:18
#!/bin/bash
location=/root/rm
find $location -mtime +30 -print | xargs rm -rf 
//-mtime是距离上一次修改时间 -print是只显示文件 xargs是获取find查找的结果在通过rm命令删除



上一篇:linux下用find删除三天前或者三天内的文件
下一篇:linux使用 screen 管理你的远程会话

The minute you think of giving up, think of the reason why you held on so long.