User Tools

Site Tools


linux:bash:cut-3-string-output-dari-awk
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


linux:bash:cut-3-string-output-dari-awk [2022/03/11 22:39] (current) – created kbadmin
Line 1: Line 1:
 +====== Cut Last 3 Char from Output AWK ======
 +Memotong 3 string terakhir dari output yang dihasilkan oleh awk
 +
 +<code>
 +cat /var/log/exim/mainlog | awk '{print $1" "$2}' | head -n 5
 +</code>
 +hasil
 +<code>
 +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
 +</code>
 +
 +kita potong
 +<code>
 +cat /var/log/exim/mainlog | awk '{print $1" "substr($2, 1, length($2)-3)}' | head -n 5
 +</code>
 +
 +Output
 +<code>
 +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
 +</code>
 +
  

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