https://www.cyberciti.biz/faq/linux-ip-command-examples-usage-syntax/

ip command examples

Don’t be intimidated by ip command syntax. Let us get started quickly with examples.

Displays info about all network interfaces

Type the following command to list and show all ip address associated on on all network interfaces:

ip a

OR

ip addr

Sample outputs:

https://www.cyberciti.biz/media/new/faq/2012/01/ip-command-show-address-ethernet-interface.png

Fig.01 Showing IP address assigned to eth0, eth1, lo using ip command

You can select between IPv4 and IPv6 using the following syntax:

### Only show TCP/IP IPv4  ##
ip-4 a

### Only show TCP/IP IPv6  ###
ip-6 a

It is also possible to specify and list particular interface TCP/IP details:

### Only show eth0 interface ###
ip a show eth0
ip a list eth0
ip a show dev eth0

### Only show running interfaces ###
ip linkls up

https://www.cyberciti.biz/media/new/faq/2012/01/Linux-ip-command-examples-for-sysadmin.png

Assigns the IP address to the interface

The syntax is as follows to add an IPv4/IPv6 address: