basic_awk
The following prints all lines in the file specified. You can also replace $0 with nothing.
1 |
awk '{ print $0 }' |
1 |
awk -F ":" '{ print $1 }' /etc/passwd |
You can also select multiple columns and separate them with a space for a better format
1 |
awk -F ":" '{ print $1 " " $2 }' /etc/passwd |
1 |
sar -q | awk '$4 >= 4' |
1 |
awk '/Luke|Joe/' test |
1 |
awk '/Luke|Joe/i' test |
1 |
awk '!/Luke/' test |
1 |
| awk '$5 ~ /[0-9]w/' |
1 |
| awk '$5 ~ /[0-9]w/ && $6 ~ /REG/' |
basic_awk.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1