I want to know if there is a way to easier way to swap the first two words of every line.
Let say my text file consist of these three lines:
Mary Joe William Edward Shawn Liam
Ultimately I want this:
Joe Mary Edward William Liam Shawn
I know this can be done by sed command by doing this:
sed -e "s/\([^ ]*\) *\([^ ]*\)/\2 \1 /g" file
But thats to much to remember.
Is there an easier way to do this.
This is bash btw.