Sobes.tech
Junior — Middle

How can you obtain the IP address of a Linux server?

sobes.tech AI

Answer from AI

To obtain the IP address of a server running Linux, you can use several commands:

  • ip addr show — displays all network interfaces and their IP addresses.
  • ifconfig — an outdated but still commonly used command to display network interface information.
  • hostname -I — outputs a list of IP addresses assigned to the host.

Example:

ip addr show
hostname -I