DEV Community

howtouselinux
howtouselinux

Posted on

check ip address in Linux

Here are the steps to check the IP address in Linux:

  1. Open a terminal: Launch the terminal application on your Linux system. This can typically be done by searching for "Terminal" in the application launcher or using a keyboard shortcut (e.g., Ctrl+Alt+T).

  2. Enter the command: Once you have the terminal open, enter one of the following commands:

    • For ifconfig: Type ifconfig and press Enter.
    • For ip addr: Type ip addr and press Enter.
    • For hostname -I: Type hostname -I and press Enter.
    • For curl ifconfig.me: Type curl ifconfig.me and press Enter.
  3. View the IP address: The command output will display the IP address information. Look for the section or line that specifies the IP address. It should be labeled as "inet" or "inet addr".

  4. Interpret the IP address: The IP address is usually presented in the format of four sets of numbers separated by periods (e.g., 192.168.0.1). This is the address assigned to your Linux system on the network.

Note that the specific command and output may vary depending on your Linux distribution and version.

linux du command - YouTube

https://www.howtouselinux.com/post/check-directory-size-in-linuxLinux is a powerful operating system that offers many features and options for users. In this...

favicon youtube.com
Command Description Example
ifconfig Displays the configuration information of all network interfaces, including the server's IP address. ifconfig
ip addr Lists detailed information of all network interfaces, including the server's IP address. ip addr
hostname -I Returns all IP addresses of the server, separated by spaces. hostname -I
curl ifconfig.me Retrieves the server's public IP address using the HTTP protocol. curl ifconfig.me

Please note that the examples assume the commands are being executed in a terminal on a Linux system. The output will vary depending on the server's network configuration and environment.

To get more detailed info about how to get ip address in Linux, check out this article here.

If you want to test your Linux skills, try the test here.

Top comments (0)