Created
November 29, 2012 14:10
-
-
Save lintianzhi/4169323 to your computer and use it in GitHub Desktop.
some pipe use, find sed grep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 目录下面所有文件的tab换成4个space 注意 '\t' 不是 "\t" | |
grep -lr '\t' . | xargs sed -i "s/\t/ /g" | |
# 查找 .py 结尾的文件 | 如果里面含有tab | 把文件的tab换成4个space # 其实第二个是多余的 | |
find . -name "*.py" | xargs grep -lr '\t' | xargs sed -i "s/\t/ /g" | |
# <ctrl-v><tab> 可以打出一个tab | |
#就像 <ctrl-v><ctrl-m> 可以打出一个^M |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment