Below awk command can be used to print particular column/field from last in command output or file.
To demonstrate this with an example, if you have file test.out with below content and 4 columns.
If you want to print second column/field from last in test.out file, your awk command looks as follows:
Below is example output of above command. As you can see it printed 2nd column.
cat <filename> | awk '{print $(NF-<column number from last>)}'
<command> | awk '{print $(NF-<column number from last>)}'
To demonstrate this with an example, if you have file test.out with below content and 4 columns.
A789652=alpha 22 33 44
A789651=alpha AA BB CC
A28ee69=beta XX YY ZZ
A28ee6a=beta 11 99 88
A2991a5=alpha 12 34 56
A789651=alpha AA BB CC
A28ee69=beta XX YY ZZ
A28ee6a=beta 11 99 88
A2991a5=alpha 12 34 56
If you want to print second column/field from last in test.out file, your awk command looks as follows:
# cat test.out | awk '{print $(NF-2)}'
Below is example output of above command. As you can see it printed 2nd column.
33
BB
YY
99
34
BB
YY
99
34