Code:
sed -rn 's/([^[:blank:]]+)[[:blank:]]+([^[:blank:]]+)/\2 \1/p' path/to/your/datafile
# or using a pipe
cat path/to/your/datafile | sed -rn 's/([^[:blank:]]+)[[:blank:]]+([^[:blank:]]+)/\2 \1/p'
Using
substitute
/regex/replacement/print statement.
The first group
() searches for a single
[ non
^ characterclass
[:blank:] ] which must occur
+ at least one times.
Then there must be at least one char of the class
[ named
[:blank:] which must occur again
+ at least one times.
Followed again by the first part to denote the ip address as well, but this time the chars end up in the second group.
The replacement then is just group
\2 followed by a blank followed by group
\1