User Tools

Site Tools


linux:bash:cut-3-string-output-dari-awk

Cut Last 3 Char from Output AWK

Memotong 3 string terakhir dari output yang dihasilkan oleh awk

cat /var/log/exim/mainlog | awk '{print $1" "$2}' | head -n 5

hasil

2022-03-06 03:22:55
2022-03-06 03:22:55
2022-03-06 03:22:55
2022-03-06 03:22:55
2022-03-06 03:22:55

kita potong

cat /var/log/exim/mainlog | awk '{print $1" "substr($2, 1, length($2)-3)}' | head -n 5

Output

2022-03-06 03:22
2022-03-06 03:22
2022-03-06 03:22
2022-03-06 03:22
2022-03-06 03:22

Layanan

Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |
linux/bash/cut-3-string-output-dari-awk.txt · Last modified: 2022/03/11 22:39 by kbadmin

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki