关于find .. | tar .. 的问题
来源:互联网 发布:男生文具盒淘宝 编辑:程序博客网 时间:2024/04/29 23:10
可以用下面的命令
find -type f -print0 |tar --null -cvf a.tar -T -
print0 表示打印文件列表 结尾是个null
--null 表示接受参数结尾是null
这主要是解决文件名中有空格的问题,也可以用在xargs命令中
解释在此,不翻译了
the best way to use find ... | xargs ...
is to use the -print0/-0 parameter on each: find -print0 ... | xargs -0 ...
. This will cause the filenames to be separated by a null character, which means you can have spaces or newlines or other weird stuff in your filenames and it will still work.
-T, --files-from FILE
get names to extract or create from FILE
-I 参数
-I replace-str
Replace occurrences of replace-str in the initial-arguments with names read from standard input. Also, unquoted blanks do not
terminate input items; instead the separator is the newline character. Implies -x and -L 1.
replace-str 一般用{} 即 -I {}
就是从标准输入读取 然后放到{}的位置上去.
find -name "libav*" |xargs -n 1 -I {} adb push {} /system/lib/
- 关于find .. | tar .. 的问题
- 关于解压 tar.gz的问题
- 关于cannot find -ltcl -ltk的问题
- 关于tar命令的选项
- 关于tar的一点笔记
- 关于.tar.gz 的使用
- 关于std::map中的find和[]的问题
- 关于std::map中的find和[]的问题
- lua 脚本 string.find 查找关于 ( ) 的问题
- 关于std::map中的find和[]的问题
- 关于std::map中的find和[]的问题
- 关于linux中cannot find -lXXX的问题
- 关于Keil Unable to find ARM libraries...问题的解决方法
- 【转载】关于std::map中的find和[]的问题
- tar解压遇到的问题
- tar命令遇到的问题
- 关于unix下tar解压时的两个错误问题及解决方法
- 关于(gzip: stdin: not in gzip format tar: ...)问题的解决
- 我再也不想在任何头文件中看到“using namespace xxx;”了
- 【设计模式】代理模式
- Bone Collector hdu2602 01背包
- 隐藏Tabbar的一些方法
- java访问远端Linux及执行远端Linux命令
- 关于find .. | tar .. 的问题
- 修改电视flash bug心得
- 二进制数求01的变换次数
- sql server 里面的convert函数,当传入参数为null时,返回null
- 关于如何读代码?
- ACM -- 蛇和梯子
- sql 增删改查
- jBPM:从jBPM3到jBPM5以及Activiti5
- Save YUV to Disk