Skip to content

Instantly share code, notes, and snippets.

@diegoulloao
Last active August 19, 2021 15:14
Show Gist options
  • Save diegoulloao/018b1941f33e183e923b8bdbcbde82f7 to your computer and use it in GitHub Desktop.
Save diegoulloao/018b1941f33e183e923b8bdbcbde82f7 to your computer and use it in GitHub Desktop.
Agrega alias para obtener IP Pública desde macOS Terminal
cd $HOME && echo "alias 'ip'='IP=\`dig +short myip.opendns.com @resolver1.opendns.com\` && echo \$IP && echo \$IP | pbcopy'" >> .bash_profile
@diegoulloao
Copy link
Author

Agrega alias a .bash_profile para obtener la IP pública desde Terminal directamente. Además la copia al portapapeles.

PASOS:

  1. Copiar y pegar en la Terminal.
  2. Reiniciar Terminal.

USO:

Usar el comando "ip" en una Terminal.

DiegoMacbook:~ diego$ ip
201.188.XXX.XXX
DiegoMacbook:~ diego$

* Además queda copiada en el portapapeles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment