This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 24,151,442 times.
Learn more...
You can view your IP address in Linux using simple terminal commands or in the GUI. The steps will vary a bit depending on whether you want to find your public IP address (the one that identifies you on the internet) or your public IP address (the one that identifies you on a local network). This wikiHow guide will teach you multiple ways to check your IP address in any version of Linux, including Ubuntu, Arch Linux, Kali Linux, and any other distro.
Quick Commands to Check Your IP Address in Linux
- Your public IP address identifies you on the internet, while your private IP address is only visible on your local network.
- To see your public IP address, use the command curl ifconfig.me or wget -qO- ifconfig.me | grep ip_addr.
- To see your private IP address, use the command ip addr, hostname -i, or ifconfig.
Steps
Community Q&A
-
QuestionWhat is an IP address?
PinguTop AnswererIt is a label that consists of four numbers separated by dots. Every computer with an internet connection is assigned an IP address. It is used so that computers can connect to each other. If you write the name of a web page into your browser's address bar, it actually looks up what IP that name refers to and then connects with that IP. -
QuestionHow can I find someone else's IP address using my own device?
PinguTop AnswererIf the device the IP of which you're trying to find has a domain name, you can use the "nslookup" function. So for example, "nslookup google.com" would give you the IP address of one of Google's servers. If it doesn't, and the device connected to your device at some time, one of the many logs (located at /var/log) can contain its IP address. Other than that, there is no way to find someone else's IP address from your device, but you can use theirs. -
QuestionWhat would I enter at the command prompt (terminal) on a Linux system to display a list of files and sub directories that exist within the present working directory?
SomoneCommunity AnswerYou can type "ls" (without quotes) to list the files and directories in the present working directory and "ls -a" to list everything, including all hidden files.
Video
Tips
References
- ↑ https://ifconfig.me/
- ↑ https://man.archlinux.org/man/ip.8
- ↑ https://man.archlinux.org/man/hostname.1.en
- ↑ https://help.ubuntu.com/stable/ubuntu-help/net-findip.html.en
- ↑ https://www.fosslinux.com/105545/the-ultimate-guide-to-linux-mint-network-configuration.htm
- ↑ https://docs.openeuler.org/en/docs/21.09/docs/desktop/Xfce-user-guide.html#3141-network
About This Article
To check your public IP address in Linux, start by clicking the Terminal app icon or simultaneously pressing “Control,” “Alt,’ and “T” to bring up the Terminal window. Once the Terminal window is open, enter the public IP command "curl ifconfig.me" to retrieve your address from a website. Press “Enter” to run the command, and wait for your public IP address to appear. Alternatively, to find your private IP address, bring up the terminal window and enter the Show IP command "ifconfig." Press Enter to run your command and display the IP address information of any network items, including your computer. In order to find your computer’s heading, look under the “wlo1” heading and review the private IP address. To learn how to use the “hostname” command to bring up your computer’s IP address, keep reading!
Reader Success Stories
-
"It's great to have several different terminal commands to choose from. I used to call ifconfig, but that isn't installed in the Docker image I'm using at the moment. Both other commands are available."..." more








