Skip to content

Instantly share code, notes, and snippets.

@dody87
Last active May 4, 2024 09:55
Show Gist options
  • Save dody87/3f7502706207faf50dc71ffc524af3f1 to your computer and use it in GitHub Desktop.
Save dody87/3f7502706207faf50dc71ffc524af3f1 to your computer and use it in GitHub Desktop.
Simple command to show your IP and nothing else on MacOS
# Step 1: open terminal.
# Step 2: nano ~/.bash_profile
# Step 3: Add the following code below
alias my-ip='ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\ -f2'
# Step 4: save file and restart terminal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment