awk
Text ProcessingPattern scanning and text processing language
Examples
Common usage examples
Print first column of each line
awk '{print $1}' file.txtPrint lines matching pattern
awk '/pattern/ {print $0}' file.txtPrint username and command from ps output
ps aux | awk '{print $1, $11}'Notes
- Powerful for column-based data processing
- $1, $2, etc. refer to columns (fields)
- $0 refers to the entire line