時(shí)間:2015/6/28來源:IT貓撲網(wǎng)作者:網(wǎng)管聯(lián)盟我要評(píng)論(0)
comm如此好用的命令,居然一直不知道,很落后。
comm 可以比較出兩個(gè)已排序文件的內(nèi)容:
NAME
comm – compare two sorted files line by line
SYNOPSIS
comm [OPTION]… FILE1 FILE2
DESCRIPTION
Compare sorted files FILE1 and FILE2 line by line.
With no options, produce three-column output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three
contains lines common to both files.
-1 suppress lines unique to FILE1
-2 suppress lines unique to FILE2
-3 suppress lines that appear in both files
–help display this help and exit
–version
output version information and exit
ex:
存在1.txt,不存在2.txt的內(nèi)容
comm -23<(sort 1.txt) <(sort 2.txt)
存在2.txt,不存在1.txt的內(nèi)容
comm -13<(sort 1.txt) <(sort 2.txt)
存在1.txt,也存在2.txt的內(nèi)容
comm -12<(sort 1.txt) <(sort 2.txt)
什么也不顯示:)
comm -123<(sort 1.txt) <(sort 2.txt)
關(guān)鍵詞標(biāo)簽:Linux
相關(guān)閱讀
熱門文章 安裝紅帽子RedHat Linux9.0操作系統(tǒng)教程使用screen管理你的遠(yuǎn)程會(huì)話GNU/Linux安裝vmware如何登錄linux vps圖形界面 Linux遠(yuǎn)程桌面連
人氣排行 Linux下獲取CPUID、硬盤序列號(hào)與MAC地址linux tc實(shí)現(xiàn)ip流量限制dmidecode命令查看內(nèi)存型號(hào)linux下解壓rar文件安裝紅帽子RedHat Linux9.0操作系統(tǒng)教程Ubuntu linux 關(guān)機(jī)、重啟、注銷 命令lcx.exe、nc.exe、sc.exe入侵中的使用方法查看linux服務(wù)器硬盤IO讀寫負(fù)載