Hands-on task
This task is step 14 of the course “Text in the terminal: grep, sed, awk”
IP addresses from a server table
/root/inventory.txt holds a server table: name ip role, the columns are aligned with spaces (there can be several spaces between them). Write only the IP addresses (the second field) to /root/ips.txt — one per line, in the original order.
What you'll practise:
- awk
- fields $1 $2
- aligned columns