Cat stands for concatenate. Case 1. When the text files have more blank lines, we want to remove them. We can use regex \s+ '\n'. cat file.txt | tr \s '\n' cat -T file.txt # show tabs as ^. cat -n file.txt # show line numbers . Specifies current dire…
cat命令 作用:连接多个文件并且打印到屏幕输出,或者重定向到其他文件,也可以用来查看显示单个文件,或者多个文件. 格式: cat [option] [file] 1,最简单的用法,直接跟文件名称,查看文件内容 ghostwu@dev:~/linux/cat$ ls ghostwu@dev:~/linux/cat$ echo 'hello,my name is ghostwu, how are you?' > test.txt ghostwu@dev:~/linux/cat$ cat test.…