Monday, March 3, 2008

Print particular line in a file


cat file.txt | awk '{if(NR==8) print $0}'

$0 = holds the whole line in awk
NR = number of records in file.txt
NF = number of fields in file.txt