Filter output from another command using awk.
Section: awk Scripting Patterns
Process command output
bash
bash
df -h | awk 'NR>1 {print $1, $5, $6}'Explanation
Awk is especially useful for command output with stable columns.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing awk Scripting Patterns
Use BEGIN and END blocks
Print headers and footers around processed output.
Print selected columns
Show the first and third whitespace-delimited fields.
Print rows matching a condition
Show lines where column 3 is greater than 100.