Linux Terminal Glossary
›
Text Processing
awk '{print $NF}' file.txt
Category:
Text Processing
awk '{print $NF}' file.txt
Copy command
Print the last field of each line
$NF is awk's built-in variable for the last field — NF stands for 'Number of Fields'. Useful when the last column position varies.
Looking for more?
Search all 7,657 commands
— works offline, in English or Spanish, and fixes typos.