cat:将文本文件读出来 (concatenate files and print on the standard output) 文件去重合并的前提条件是先取出文件的内容。
uniq: 用来处理重复的行。(report or omit repeated lines) Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output). 从输入或者标准输入中过滤邻近的行,写到输出文件或者标准输出中。所以此命令只能处理邻近的行, 如果对两个文件进行合并去重,则必须首先对其排序,实现一一对应,否则去重失败。
sort:对文本的行进行排序(sort lines of text files) Write sorted concatenation of all FILE(s) to standard output. 对于去重而言使用默认排序方式就可以了。
paste:merge lines of files 将按行将不同文件行信息放在一行。缺省情况下, p a s t e连接时,用空格或t a b键分隔新行中不同文本,除非指定- d选项,它将成为域分隔符。