>_ IzzyLab

Topic breakdown

Capture groups help swap parts of a line in sed: in the pattern the pieces you need go in parentheses, and in the replacement you output them by number \1, \2 in any order and with any separators. With -E the parentheses work as groups without escaping. The character class for each group should be chosen so the group can't "climb" over the separator: a host name consists of letters, digits and a hyphen, an address of digits and dots, and neither contains a space.

What's checked

  1. columns swapped: ip name

What it looks like