Your Address
An IP address is a number that names one machine on a network. The ip command prints the addresses of this machine.
The machine name
The name and the numbers belong to the same machine.
$ hostnameThe numbers
Each row is one address of this machine.
$ ip -brief addrWhat it listens for
The list shows what this machine listens for. An empty list means nothing listens yet.
$ ss -tlnExample
$ hostname
$ ip -brief addrKey points
- Use ip -brief addr to list the addresses of this machine.
- The lo row is this machine itself.
- Use ss -tln to list what this machine listens for.
- The -brief option keeps the list short.
- ss -tln asks for the listening rows, shown as numbers.
- Your addresses will differ from the addresses shown here.
In this example, hostname prints the name of this machine. The ip command then prints the addresses. Your name and numbers will differ from the ones shown here.
Note
The numbers change when the machine joins another network.
Try it Yourself
Edit the code, then press Run.
Running is simulated
Exercise
What does ip -brief addr print?