In the Linux operating system, the ability to display IPv4 addresses is crucial for network configuration, troubleshooting, and understanding the network environment. Whether you are a system administrator managing multiple servers or a developer working on network-related applications, knowing how to effectively display IPv4 information can greatly assist in your tasks. This article will guide you through various methods to display IPv4 in Linux, covering both command-line tools and graphical interfaces.

One of the most common ways to display IPv4 in Linux is by using the ifconfig command. This command provides detailed information about network interfaces, including their IP addresses, subnet masks, and broadcast addresses. To use ifconfig, simply open a terminal and type "ifconfig" followed by the name of the network interface you want to view. For example, if you want to view the information for the eth0 interface, you would type "ifconfig eth0". The output will display the IPv4 address assigned to the interface, along with other network configuration details.
Another useful command for displaying IPv4 in Linux is ip addr. This command provides a more modern and user-friendly alternative to ifconfig. It also offers additional features such as the ability to view multiple network interfaces simultaneously and filter the output based on specific criteria. To use ip addr, open a terminal and type "ip addr". The output will display a list of network interfaces, each with its associated IPv4 address and other network configuration details.
In addition to the command-line tools, there are also graphical interfaces available for displaying IPv4 in Linux. One such tool is the NetworkManager application, which is commonly used in many Linux distributions. To use NetworkManager to view IPv4 information, open the application and navigate to the network connection you want to view. The application will display the IPv4 address assigned to the connection, along with other network configuration details.
Another graphical tool for displaying IPv4 in Linux is the nm-connection-editor. This tool allows you to manage network connections and view detailed information about each connection, including its IPv4 address, subnet mask, and gateway. To use nm-connection-editor, open the application and select the network connection you want to view. The application will display a summary of the connection details, including the IPv4 address.
In some cases, you may need to display IPv4 information for all network interfaces on your Linux system. To do this, you can use the -a option with the ifconfig or ip addr command. For example, to view the IPv4 addresses for all network interfaces using ifconfig, you would type "ifconfig -a". The output will display the IPv4 addresses for all network interfaces on your system.
Similarly, to view the IPv4 addresses for all network interfaces using ip addr, you would type "ip addr show". The output will display a list of all network interfaces, each with its associated IPv4 address and other network configuration details.
In addition to displaying the IPv4 address, you may also want to view other network configuration details such as the subnet mask, gateway, and DNS servers. To view this information using ifconfig, you can look for the relevant fields in the output. For example, the subnet mask is usually displayed as a dotted quad number, and the gateway is usually listed under the "default" route.
To view this information using ip addr, you can look for the relevant fields in the output. The subnet mask is usually displayed as a prefix length, and the gateway is usually listed under the "default via" field.
To view the DNS servers configured on your Linux system, you can use the nmcli command. This command allows you to manage network connections and view detailed information about each connection, including its DNS servers. To use nmcli to view the DNS servers, open a terminal and type "nmcli device show". The output will display a list of network devices, each with its associated DNS servers.
In conclusion, displaying IPv4 in Linux is an essential task for network configuration, troubleshooting, and understanding the network environment. By using the various command-line tools and graphical interfaces available, you can easily view the IPv4 address and other network configuration details for your Linux system. Whether you are a beginner or an experienced Linux user, these tools will help you manage your network connections effectively and ensure that your system is properly configured for network communication.