basic_awk
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| basic_awk [2015/04/25 10:33] – created luke7858 | basic_awk [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| awk '{ print $0 }' | awk '{ print $0 }' | ||
| </ | </ | ||
| - | The following will only print the first colomn | + | The following will only print the first column |
| <sxh bash> | <sxh bash> | ||
| awk -F":" | awk -F":" | ||
| </ | </ | ||
| + | \\ | ||
| + | You can also select multiple columns and separate them with a space for a better format | ||
| + | <sxh bash> | ||
| + | awk -F":" | ||
| + | </ | ||
| + | Grab every instance where column is greater than 4 | ||
| + | <sxh bash> | ||
| + | sar -q | awk '$4 >= 4' | ||
| + | </ | ||
| + | Awk for multiple words | ||
| + | <sxh bash> | ||
| + | awk '/ | ||
| + | </ | ||
| + | Awk for multiple words case insensitive: | ||
| + | <sxh bash> | ||
| + | awk '/ | ||
| + | </ | ||
| + | awk inversely | ||
| + | <sxh bash> | ||
| + | awk ' | ||
| + | </ | ||
| + | \\ | ||
| + | \\ | ||
| + | <sxh bash> | ||
| + | | awk '$5 ~ / | ||
| + | </ | ||
| + | <sxh bash> | ||
| + | | awk '$5 ~ /[0-9]w/ && $6 ~ /REG/' | ||
| + | </ | ||
| + | |||
basic_awk.1429957995.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
