Awk command with simple examples
Now, we are going to learn very interesting and Most important in Linux Why late lets know about Awk command,one of the mostly used command in scripting. awk command used to manipulate data | using this AWK command we can generate specified reports as per our requirement. Syntax : awk ‘BEGIN {start_action} {action} END {stop_action}’ filename let me explain about awk command with simple examples Example 1: How to print entire data of the file cat filename | awk '{print}' cat filename | awk '{print$0}' both " awk '{print}' and awk '{print$0}' " used to print entire date Example 2: How to print very first column cat filename| awk '{print$1}' awk '{print$1}' used to print very first column awk '{print$1}' used to print second column Example 3: How to print p attern Matching Technique in Awk. free -m | awk '{/Mem/print}' here, we are matching Mem using awk '{/Mem/p...
Comments
Post a Comment