awk
Basic Syntax
awk 'pattern { action }' [file...]Most Useful awk Commands
awk Commands1. Print Specific Columns
awk '{print $1, $5}' server.log$1 (Date)
$5 (Status)
2. Filter by Condition
3. Print Matching Lines
4. Count Matching Lines
5. Custom Field Separator
6. Perform Calculations
7. Highlight or Format Output
Piping with awk
awkExamples
1. Monitor Running Processes and Extract Fields
2. Filter Network Connections
3. Real-Time Log Analysis
4. Combined Pipes for Advanced Filtering
awk Cheatsheet

Last updated