Ubuntu get the last word in a sentence from a text file
linux, shell, ubuntu, unix
Solution
AWK can do that :
$ echo "word0 word1 word2 word3 word4 word5 word6" | awk '{ print $(NF) }'
word6
Problem
I have a tab separated text file structured as follows: ``` word0 word1 word2 word3 word4 word5 word6 ``` From a linux commond line I want to: - Get only word6 - How would I get only the characters ord6 in word6?