In awk, FNR refers to the record number (typically the line number) in the current file and NR refers to the total record number.
What is NR in awk command Mcq?
Explanation: awk uses the built-in variable NR to specify line numbers.
What is $NR in awk?
NR is a AWK built-in variable and it denotes number of records being processed. Usage : NR can be used in action block represents number of line being processed and if it is used in END it can print number of lines totally processed. Example : Using NR to print line number in a file using AWK.