command Flashcards
(5 cards)
1
Q
print first column of command delimited
A
awk -F”,” ‘{print $1}’ file1
2
Q
omit first line, afterward print entire line
A
awk ‘NR!=1{print $0}’ file1
3
Q
set a field separator and pass a value
A
awk ‘{print $0,val}’ OFS=, val=$x file1
4
Q
comma delimited, 1st column only exactly matches Rent or Medicine, print entire line
A
awk -F, ‘$1 ~ /^Rent$|^Medicine$/’ file
5
Q
comma delimited, print matching Medicine and 2nd column greater than 500
A
awk -F, ‘/Medicine/ && $2>500’ file