User Tools

Site Tools


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

Differences

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

Link to this comparison view

linux:bash:cut-3-string-output-dari-awk [2022/03/11 22:39] (current)
kbadmin created
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