Let's Create Own Simple Command 002

kojikanao profile image Koji (he/him) ・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


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

Step 3 Test


$ gip <-- you will see your global ip address


markdown guide