
linux常用命令总结
游泳的鲨鱼
很久没登录优快云了,一方面是因为平时工作忙,另以方面是我现在已经不做以前的工作了。所以以前写的文章,如果有人有疑问,想进一步询问,我都不知道怎么回了。所以呢,就不怎么登录。
展开
-
grep在当前目录下从指定类型文件中搜素字符串
grep -rin --include=*.xml "test" . | grep -v strings.xml注:在当前目录下,从xml类型文件中搜素test,从结果集中去掉strings.xml.-i, --ignore-case-n, --line-number-c, --count-r, --recursive-v, --invert-match-E原创 2013-11-08 14:29:46 · 1753 阅读 · 0 评论 -
利用find和grep组合查找特定文件下的内容
find . -iname .repo -prune -o -iname .git -prune -o -type f -iname "*/.java" -print0 | xargs -0 grep --color -n "test"在后缀为.java文件中查找内容test并以颜色标注显示查找到的内容及行号表达式解释find . 在当前目录及子目录查找 -inam原创 2014-03-06 11:40:16 · 2557 阅读 · 0 评论 -
find中的-print0和xargs中-0的奥妙
默认情况下, find 每输出一个文件名, 后面都会接着输出一个换行符 ('n'), 因此我们看到的 find 的输出都是一行一行的:[bash-4.1.5] ; ls -ltotal 0-rw-r--r-- 1 root root 0 2010-08-02 18:09 file1.log-rw-r--r-- 1 root root 0 2010-08-02 18:转载 2014-03-06 11:14:50 · 723 阅读 · 0 评论 -
touch目录树下的所有文件
find ./ -type f |xargs touch原创 2014-09-24 18:53:13 · 3529 阅读 · 0 评论 -
Linux查找并复制文件的方法
find . -iname Phone.apk -exec cp {} ../ \;find . -iname Phone.apk | xargs -i cp {} ../查找并删除文件的方法:find . -iname *.apk | xargs rm -fr原创 2014-11-27 09:45:58 · 1857 阅读 · 0 评论 -
inux批量替换文件名中的字符串
把当前文件名中所有cl字符修改成ruls -r | rename s/cl/ru/原创 2014-03-11 14:56:05 · 1168 阅读 · 0 评论