Let's Create Own Simple Command 002

twitter logo github logo ・1 min read

Sometimes we want to know our global IP address. Actually, we can check with googling ip address, but why need to open Chrome for that???
(I guess most people are using Chrome for something while they are working, but still need to open a new tab)

Step 1 Create bash/zsh file

$ cd
$ mkdir .sh <-- if you don't have this
$ vim gip.sh
#!/usr/bin/env zsh
curl http://checkip.amazonaws.com/

Step 2 Add a new alias

.zshrc

alias gip="~/.sh/gip.sh"

Step 3 Test

test

$ gip

111.111.111.111 <-- you will see your global ip address
twitter logo DISCUSS
Classic DEV Post from May 24

ECMAScript Classes - Keeping Things Private

Koji profile image
Software Engineer in NYC/Research Resident@NYU-ITP18-19 code to do something weird/useless/helpful Japanese