find tar 压缩第一层目录,用于资料备份。
find *.tar.gz -exec tar zxvf '{}' \;
//查找当前目录下的.tar.gz 的文件的 并发送给后面的命令执行
find . -maxdepth 1
//查找当前目录下的文件并显示出来。
find . -maxdepth 1 -type d
//查找当前目录下的文件
find . -maxdepth 1 -type d -exec cp -r '{}' /home/android/autonavi-project/ ';'
//查找当前目录 并拷贝到某个位置
find . -maxdepth 1 -type d -exec tar zcvf '{}'.tar.gz '{}' ';'
//对当前目录压缩后放到当前目录。
// -maxdepth 0表示先显示现在的目录再显示其他的。
find . -maxdepth 1 -type d -exec tar zcvf /test2/'{}'.tar.gz '{}' ';'
//对当前目录压缩后放到指定(/test2/)。
find /test -path /test/a -prune -o -name "*" -print
//查找test目录下,显示除了a文件夹之外的文件
find /test2 -path /test2/a.tar.gz -prune -o -name "*" -print
//查找test2目录下的除了 a.tar.gz 的所有的文件和目录。
find /test2 -path /test2/..tar.gz -prune -o -name "*.tar.gz" -exec tar zxvf '{}' \;
//查找test2目录下的除了..tar.gz 的所有.tar.gz的进行解压。
find /test2 -path /test2/. -prune -o -name "*" -exec tar zcvf '{}'.tar.gz '{}' \;
//查找test2目录下的除了.这个目录外的所有目录进行压缩。
//本文件的终极目标,一个目录下的目录进行压缩。不对当前目录进行压缩。并且不对OUT文件进行压缩。
find . -mindepth 1 -maxdepth 1 -path "./out" -prune -o -type d -exec tar zcvf '{}'.tar.gz '{}' ';'
//
最新文章
- 【转】 FineBI:自助式BI工具打造业务分析的“快与准”
- sql 知识点系统汇总
- Windows Phone 十九、罗盘
- __PUBLIC__ 路径更改
- windows.open()、close()方法详解
- DEDECMS中,channelartlist标签
- 选择器,$(";A+B";) 和$(";A~B";) 的理解
- 2008r2 显示桌面图标
- POJ 3654 &;amp; ZOJ 2936 &;amp; HDU 2723 Electronic Document Security(模拟)
- 一、Solr的相关概念了解
- 洛谷P1171 售货员的难题【状压DP】
- Spring中你可能不知道的事(二)
- pycharm opencv4.0安装使用
- hadoop环境配置
- HTML页面本地正常,部署到服务器稍微异常解决方案
- zend studio mac
- 自定义SharePoint2013 master page
- SVN提交报错(SVN的bug)
- Spring IOC(四)FactoryBean
- zabbix自定义web检测