User Tools

Site Tools


linux:bash:command-awk

Differences

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

Link to this comparison view

Next revision
Previous revision
linux:bash:command-awk [2020/09/30 05:18] – created kbadminlinux:bash:command-awk [2023/06/29 05:49] (current) – [Menghapus Blank Line] kbadmin
Line 16: Line 16:
 <code> <code>
 awk -F"rip=" ' {print $2}' /var/log/maillog awk -F"rip=" ' {print $2}' /var/log/maillog
 +</code>
 +===== Menghapus Blank Line =====
 +MEnghapus blank line yang dihasilkan dari perintah tail
 +<code>
 +cat /var/log/maillog | grep failed | awk -F"rip=" ' {print $2}' | cut -d, --output-delimiter ' ' -f 1 
 +</code>
 +terdapat beberapa blank line dan cara menghapusnya adalah dengan menambahkan
 +<code>
 +cat /var/log/maillog | grep failed | awk -F"rip=" ' {print $2}' | cut -d, --output-delimiter ' ' -f 1,2 | awk 'NF' 
 </code> </code>
  
 +===== Mendapatkan String Terakhir =====
 +Mendapatkan nilai terakhir dari awk
 +
 +<code>
 +awk -F '.' '{print $(NF - 1)}'
 +</code>
  

Layanan

Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |
linux/bash/command-awk.1601457496.txt.gz · Last modified: 2020/09/30 05:18 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