cut last column from a file in unix code example Example: remove last field using awk awk 'NF{NF-=1};1' <in >out