第二章:常用命令

1、cat

     cat -s //多个空白行压缩成一个      cat *.txt | tr -s    //移除空白行     cat -n //加行号

2、find
沿着文件层次结构向下遍历,匹配符合条件的文件,并执行相应的操作。
eg:

find ./ ! -name "*.txt" -print[root@localhost program_test]# find ./  -type f -name "*.swp" -delete

3、xargs 将标准输入数据转换成命令行参数。

[root@localhost program_test]# cat out.txt | xargs  //将单行转化为多行[root@localhost program_test]# cat out.txt | xa

收藏 打印