AWK – How to Print Last Two Columns awk All I want is the last two columns printed. Best Answer You can make use of variable NF which is set to the total number of fields in the input record: awk '{print $(NF-1),"\t",$NF}' file this assumes that you have at least 2 fields. Related SolutionsAWK – How to Print Second-to-Last Column/Field awk '{print $(NF-1)}' Should work Related Question
Best Answer
You can make use of variable
NF
which is set to the total number of fields in the input record:this assumes that you have at least 2 fields.