awk

root@DESKTOP-K1E4UTA:~# awk '{print $3 "\t" $4}' marks.txt
Physics 80
Maths 90
Biology 87
English 85
History 89

root@DESKTOP-K1E4UTA:~# awk '{print}' marks.txt

  1. Amit Physics 80
  2. Rahul Maths 90
  3. Shyam Biology 87
  4. Kedar English 85
  5. Hari History 89

root@DESKTOP-K1E4UTA:~# awk '/a/ {print $0}' marks.txt
2) Rahul Maths 90
3) Shyam Biology 87
4) Kedar English 85
5) Hari History 89

awk '/re 表达式/'

posted @ 2024-03-17 17:20  前海渔文乐  阅读(17)  评论(0编辑  收藏  举报