To find out your IP address on a Red Hat Linux system, you can use the ip
command.
To display the IP address of your system, you can use the following command:
ip addr show
This will display a list of network interfaces and their corresponding IP addresses.
If you want to display only the IP address of a specific interface, you can use the -4
option to display only IPv4 addresses, or the -6
option to display only IPv6 addresses. For example, to display the IPv4 address of the eth0
interface, you can use the following command:
ip -4 addr show eth0
This will display the IPv4 address of the eth0
interface.
If you want to display the IP address in a more concise format, you can use the awk
command to extract the IP address from the output of the ip
command. For example, to display the IPv4 address of the eth0
interface in a single line, you can use the following command:
ip -4 addr show eth0 | awk '$1 == "inet" {print $2}'
This will extract the IPv4 address from the output of the ip
command and display it on a single line.
You can find more information about the ip
command and its options in the ip
documentation or by running the ip --help
command.