shell脚本 grep cut tee diff

Posted we1less

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了shell脚本 grep cut tee diff相关的知识,希望对你有一定的参考价值。

grep    行工具

grep  [选项]  ‘关键字’  文件名
grep --color=auto 'android' Android.mk

别名的用法  当前目录

alias grep='grep --color=auto'

OPTIONS 

代码段 小部件


cut    列截取工具

grep  [选项]  文件名

OPTIONS 

cut -d= -f1 Android.mk   -d=  以=分割   -f1 第1列

cut -d= -f1,7 Android.mk -f1,7 第1列和第7列


tee 

echo godv | tee godv.txt  
echo godv | tee -a godv.txt     追加

diff

diff [选项] 文件1 文件2
diff -u 文件1 文件2  跟git差不多

 

以上是关于shell脚本 grep cut tee diff的主要内容,如果未能解决你的问题,请参考以下文章