cURL An Alternative To Many Applications. Here Is How?

Don't Use Web Browsers For Simpler Tasks ๐Ÿฅฑ


8 min read

cURL An Alternative To Many Applications. Here Is How?

The world is very dependent on browsers for even doing simple tasks. File sharing, checking public IP addresses, weather forecast, internet speed tests and other stuff that we IT forks do sometimes like - using neofetch, cheatsheets and DNS checks etc, are not really suckless ways to use. Because why you wanna download thousands of lines of code just to check system configuration (neofetch), this is bloated. So, today we'll see a suckless way to achieve this whole stuff from terminal using cURL. Let's go ahead and do some less bloated IT ninja stuff.

Public IP Address

Getting a current network public IP address. Sometimes seems important or we just wanna know. So, don't need open the browser. Just try


This will simply return your public IP on stdout.

Get Reboust Info From Public IP Address

Curious about what possibly website see just from your IP address? If yes, I gotch you. Type...

curl -s

Or, If you want any specific information. Use below command

curl -s,continentCode,country,countryCode,region,lon,currency,isp

You can add more comma-separated fields to specifically get what you want.

Possible Fields

  • status

  • message

  • continent

  • continentCode

  • country

  • countryCode

  • region

  • regionName

  • city

  • district

  • zip

  • lat

  • lon

  • timezone

  • offset

  • currency

  • isp

  • org

  • as

  • asname

  • reverse

  • mobile

  • proxy

  • hosting

  • query

Json Fix?

All the above robust commands will return a JSON representation which needs to be formed to look good. So, for that, we need a tool, jq. You can install it depending on your platform.

For Debian/Ubuntu Based OS

sudo apt install jq

For Arch Based OS

sudo pacman -Sy jq

It's also available for another operating system check here.

So, let's print the public info in proper JSON format.

curl -s | jq

This will output something like that

  "query": "",
  "status": "success",
  "continent": "North America",
  "continentCode": "NA",
  "country": "Canada",
  "countryCode": "CA",
  "region": "QC",
  "regionName": "Quebec",
  "city": "Montreal",
  "zip": "H1K",
  "lat": 45.6085,
  "lon": -73.5493,
  "timezone": "America/Toronto",
  "isp": "Le Groupe Videotron Ltee",
  "org": "Videotron Ltee",
  "as": "AS5769 Videotron Telecom Ltee",
  "asname": "VIDEOTRON",
  "reverse": "",
  "proxy": false

Get DNS provider

curl -L | jq

This will return your DNS provider and DNS server IP address.

Quick URL Shorten

curl -F url=<link>

Replace <link> with the actual URL. This will return a shorted URL. Something like that.

โ””โ”€โ”€โ•ผ $curl -F url=

You can also pass slug as a parameter (slug refers to a random string at the end of shorted URL).

curl -F url=<link> -F slug=<any string>

For Example

โ””โ”€โ”€โ•ผ $curl -F url= -F slug=flarexes

Better Way To File Transfer

This one is my favourite even though I actually wrote an article on that, File sharing from terminal which suck less. Let's see, How does it work?

Working is very simple we gonna use This site accepts the location of a file that you wanna share and then return a shareable link.

curl -F 'file=@<file location>'

It would be like this

โ””โ”€โ”€โ•ผ $curl -F 'file=@/home/radowoo/Desktop/test'

This is the best way. I ever found to share the files. Don't forget to check out the File Sharing Via cURL for more info.


A very simple and quick way to see a cheatsheet about many commands. For that we gonna use

The only cheat sheet you need Unified access to the best community-driven documentation repositories in the world.

curl<any command>

Let's have a glance

โ””โ”€โ”€โ•ผ $curl

# file
# Determine file type.
# More information: <>.

# Give a description of the type of the specified file. Works fine for files with no file extension:
file filename

# Look inside a zipped file and determine the file type(s) inside:
file -z

# Allow the file to work with special or device files:
file -s filename

# Don't stop at the first file type match; keep going until the end of the file:
file -k filename

# Determine the mime encoding type of a file:
file -i filename

Simple sort and sweet. Their home page is also very cool and informative. Have a look!

โ””โ”€โ”€โ•ผ $curl
      _                _         _    __                                        
  ___| |__   ___  __ _| |_   ___| |__ \ \      The only cheat sheet you need    
 / __| '_ \ / _ \/ _` | __| / __| '_ \ \ \     Unified access to the best       
| (__| | | |  __/ (_| | |_ _\__ \ | | |/ /     community driven documentation   
 \___|_| |_|\___|\__,_|\__(_)___/_| |_/_/      repositories of the world        

+------------------------+ +------------------------+ +------------------------+
| $ curl     | | $ btrfs         | | $ lua/:learn    |
| $ curl    | | $ tar~list      | | Learn any* programming |
| $ curl | |                        | | language not leaving   |
| $ curl  | |                        | | your shell             |
|                        | |                        | | *) any of 60           |
|                        | |                        | |                        |
+-- queries with curl ---+ +- own optional client --+ +- learn, learn, learn! -+
+------------------------+ +------------------------+ +------------------------+
| $ go/f<tab><tab>| | $ --shell       | | $ go zip lists  |
| go/for   go/func       | |> help           | | Ask any question using |
| $ go/for        | | ...                    | | or curl |
| ...                    | |                        | | /go/zip+lists          |
|                        | |                        | | (use /,+ when curling) |
|                        | |                        | |                        |
+---- TAB-completion ----+ +-- interactive shell ---+ +- programming questions-+
+------------------------+ +------------------------+ +------------------------+
| $ curl    | | $ vim           | | $ time curl    |
| see /:help and /:intro | | ...                    | | ...                    |
| for usage information  | | zip lists _            | | real    0m0.075s       |
| and on GitHub| | <leader>KK             | |                        |
| for the details        | |             *awesome*  | |                        |
|            *start here*| |                        | |                        |
+--- self-documented ----+ +- queries from editor! -+ +---- instant answers ---+

[Follow @igor_chubin for updates][]

Random Jokes

Sometimes, We just want that. Sometimes ๐Ÿค”


That's set...

Text To QR Code

I don't know how many of you will do that. But yaa! we have an option for that. You can generate a QR code which will consist of text or string? And, Of course, this works perfect on the terminal.


You can also share multiple lines like that

printf "two\nlines" | curl -F-=\<-

But, The way I prefer is to read text from a file

cat | curl -F-=\<-

Weather In Console

Stop using an application to check the weather. That ask for location. I don't want that. We have a better way or the right way to check curl the weather!

Just do...

curl<your location>

# Example `curl`

No permission granting required

โ””โ”€โ”€โ•ผ $curl

Weather report: USA+Boston

     \  /       Partly cloudy
   _ /"".-.     21 ยฐC          
     \_(   ).   โ†‘ 22 km/h      
     /(___(__)  16 km          
                0.0 mm         

Location: Boston, Suffolk County, Massachusetts, United States [42.3554334,-71.060511]

Follow @igor_chubin for updates provides you more control over how you wanna see the weather information for that check out their GitHub Repo.

Execute Script Without Downloading Them

Have you ever used neofetch? Or Did you ever try to test your internet speed? If yes! Then, stop doing that because you can achieve these simple tasks from the command line via cURL.

But, You may think. Why would I encourage you not to download neofetch? Because I'm not a big fan of tools that just gives some system info using an 11k line of code. Yes, that's true. I think we can get this information via creating our own script but If you still want that 11k line of codes, then use them without downloading. Here is how.

curl -sL | bash

Above command will simply fetch the neofetch script from GitHub temporarily and then execute it from bash. And, This will be removed when it's done.

But, There are several awesome utilities on GitHub. That you may wanna use some time just like Internet Speed Test. For that, just do

curl -s | python -

Make Thing Simpler

All the above commands are not supposed to be typed every time you use them. Instead, these all should be aliased into a .zshrc or .bashrc files. So, I did that for you.

# Returns Public IP Address
alias myip='curl -4'

# Returns Public Information In JSON
alias ipinfo='curl -s | jq'

# Returns Current DNS Info In Json
alias mydns='curl -sL | jq'

# Returns Shorted URL
alias shorturl='function _e(){ curl -F "url=$1"; };_e'

# Returns Shorted URL With Specified Slug
alias slugurl='function _e(){ curl -F "url=$1" -F "slug=$2"; };_e'

# Share File
# Check out File Sharing Via cURL ( for more better alias to share files
alias fshare='function _e(){ curl -F "file=@$1"; };_e'

# Returns Cheatsheet Of Specified Command
alias cheat='function _e(){ curl$1; };_e'

# Random Jokes That Wouldn't Make You Laugh
alias joke='curl'

# Text To QR Code
alias tqr='function _e(){ printf "$1" | curl -F-=\<-; };_e'

# See Current Weather
alias weather='curl'

# Useful Scripts
alias neofetch='function _e(){ curl -sL | bash; };_e'
alias netspeed='function _e(){ curl -s | python3 -; };_e'

Note: Many of these services store your data to work properly ( Who Knows? ) except a few ones.

Want more websites like that! Then check out Awesome Console Services GitHub repository which maintains such services. So, that's set for now. Good Bye!