You can find your IP address in Linux using the following methods:
- Using the
ip
command:
ip addr show | grep 'inet ' | grep -v 127.0.0.1 | awk '{print $2}'
This will show your IP address (or addresses) along with the associated network interfaces.
- Using the
hostname
command:
hostname -I
This will show your IP address (or addresses) assigned to the host.
- Using the
ifconfig
command:
ifconfig | grep 'inet ' | grep -v 127.0.0.1 | awk '{print $2}'
This will show your IP address (or addresses) along with information about your network interfaces.
- Using the
curl
command:
curl ifconfig.me
This will show your public IP address.