shell find and rm
2015-09-16 14:24
603 查看
按时间删除命令: 删除当前目录下30天以前的所有文件: find . -type f -ctime +30 -exec rm -fr {} \; 删除当前目录下30天以前的所有目录: find . -type d -ctime +30 -exec rm -fr {} \; 删除/oracle/123目录下3天以前的文件: find /oracle/123 -type f -ctime +3 -exec rm -rf {}\ ; 删除当前目录下30天以前,名称匹配"*awr*.html"的文件: find . -type f -name "*awr*.html" -ctime +30 -exec rm -fr {} \;
相关文章推荐
- shell date
- Powershell 查询 Windows 日志
- Powershell 查询 Windows 日志
- shell脚本如何获取当前时间
- 9月13日 bash
- shell基础
- shell脚本中的awk脚本语法
- Ubuntu安装jdk报错:-bash /usr/.../java:No such file or directroy
- 用python和shell检测centos版本
- [python] 0x2 Python Tutorial: Reverse Shell
- L7.1 linux shell总结
- xshell连接虚拟机在家能用到公司就不能用了?
- Shell脚本编写教程
- Xshell中文乱码问题
- Shell简介:什么是Shell,Shell命令的两种执行方式
- PowerShell管理Win Server 2008 R2
- xshell ssh 退出后进程被杀死
- SharePoint PowerShell命令系列 (13) Get-SPWebApplication & Set-SPWebApplication
- 浅谈PowerShell 捕获错误
- SSH Secure Shell Client中文乱码的解决方法