grep pattern in the last word of the line code example Example: grep last word in line awk 'NF>1{print $NF}'