Find IP address in Linux Operating System

Asked By 7060 points N/A Posted on -
qa-featured

I am new in Linux operating system, How can I find IP address in Linux Operating system by using shell command?

SHARE
Best Answer by Hoting Gracia
Best Answer
Best Answer
Answered By 5 points N/A #82600

Find IP address in Linux Operating System

qa-featured

Hi Anonymous, hope the following steps will guide you in fixing this issue.:..:

–> As you said that you are one of the users of the Linux to know your systems IP address or other information related to the network first thing is the users must have the administrator privileges.

–> If you are utilizing a GUI interface for your Linux/Unix machine then you need to just open the Linux/Unix shell In the prompt that you had opened type as "ifconfig eth0 " excluding quotes and then press enter hence this results in the listing of the information that is related to the network.

–> Generally users see commonly the network settings available for all their network devices when we run the "ipconfig" command.

–> For Home network/corporate network users the information is the IP address of your computer in your network and If your computer gets connected to the Internet automatically the IP address is more likely which not be the IP address of the other people and web pages see. 

Thank you.. 🙂

Answered By 0 points N/A #82601

Find IP address in Linux Operating System

qa-featured

The best way to look up your Linux IP address if you are new to Linux is by utilizing the bash shell command. By typing the ‘ifconfig’ command you will get useful data such as the IP address and its corresponding Mac address, the subnet mask and other handy information too. The best way to look up your Linux IP address is by utilizing the bash shell command. By typing the ‘ifconfig’ command you receive useful data such as the IP address and its corresponding Mac address, the subnet mask and other handy information too.

 Here's the code:

/sbin/ifconfig 
| grep '<inet>' 
| sed -n '1p' 
| tr -s ' ' 
| cut -d ' ' -f3 
| cut -d ':' -f2

This will give you the IP address, in order to get the Mac address then refer to the code below.

/sbin/ifconfig 
| grep 'eth0' 
| tr -s ' ' 
| cut -d ' ' -f5

I believe that this will help you out,should you need further assistance i suggest you visit http://www.linuxjournal.com

Related Questions