原文:shell操作文件的幾條命令:刪除最后一列、刪除第一行、diff等

刪除文件第一行: sed d filename 刪除文件最后一列: awk print NF filename awk刪除重復行的命令:awk if seen print filename 比較文件的兩種方法: comm nocheck order file file grep v f file file :輸出file 中有file 中沒有的行 當然還有diff file file 貼一段昨天寫 ...

2013-06-28 17:40 0 6025 推薦指數:

查看詳情

shell刪除最后一列刪除第一行、比較文件

刪除文件第一行: sed -i '1d' filename 刪除文件最后一列: awk '{print $NF}' filename 比較文件的方法: 1)comm -3 --nocheck-order file1 file2 2) grep -v -f file1 ...

Mon Apr 13 17:39:00 CST 2015 0 21140
刪除文件第一列 -Linux

刪除文件 text中第一列 方式一 awk '{$1="";print $0}' text 方式二 sed -e 's/[^ ]* //' text ...

Sat Sep 23 22:58:00 CST 2017 0 3075
awk命令獲取文件的某一行一列

1.打印文件第一列  :awk '{print $1}' filename 2.打印文件的前兩  :awk '{print $1,$2}' filename 3.打印完第一列,然后打印第二  :awk '{print $1 $2}' filename 4.打印文本文件的總行 ...

Sat May 09 23:34:00 CST 2020 0 887
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM