ItSolutionStuff.com

How to get Public IP in Linux Ubuntu Terminal?

By Hardik Savani β€’ May 1, 2024
Ubuntu

Hi,

This is a short guide on how to get public ip address in ubuntu terminal. let’s discuss about how to get public ip address in linux terminal. We will look at an example of ubuntu get public ip command line. In this article, we will implement a ubuntu get public ip address command line.

To obtain your public IP address in a Linux Ubuntu 22.04 terminal, you can use various methods. One common approach is to use external services like `curl` or `wget` to fetch your IP address from the internet. Here are two methods you can use:

Method 1: Using `curl` with ifconfig.me:

Open your terminal and run the following command:

curl ifconfig.me

This command will make a request to the ifconfig.me service and display your public IP address in the terminal.

Method 2: Using `curl` with icanhazip.com:

You can also use the icanhazip.com service with `curl`:

curl icanhazip.com

This will provide your public IP address as a response.

Both methods will give you your public IP address. Choose the one that works best for you, as both services should provide similar results.

I hope it can help you...

Tags: Ubuntu
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

πŸ“Ί Subscribe on YouTube

We Are Recommending You

β˜…

How To install Wine 7.0 on Ubuntu 22.04?

Read Now β†’
β˜…

How to Install the Telegram Desktop App in Ubuntu?

Read Now β†’
β˜…

How to Find File In Linux Ubuntu?

Read Now β†’
β˜…

How to Uninstall NGINX in Ubuntu 22.04?

Read Now β†’
β˜…

How to Install FFmpeg in Ubuntu 22.04?

Read Now β†’
β˜…

How to Delete and Remove File in Ubuntu Terminal?

Read Now β†’
β˜…

How to Install and Setup Supervisor in Ubuntu for Laravel?

Read Now β†’
β˜…

Ubuntu PHP bz2 Extension Install Commands Example

Read Now β†’
β˜…

How to Install PHP GD Extension in Ubuntu?

Read Now β†’
β˜…

How to Install PHP imap Extension in Ubuntu?

Read Now β†’
β˜…

How to Install PHP Curl Extension in Ubuntu?

Read Now β†’
β˜…

How to Increase upload_max_filesize in PHP Ubuntu?

Read Now β†’
β˜…

How to Increase post_max_size in PHP Ubuntu?

Read Now β†’