Last active
May 4, 2024 09:55
-
-
Save dody87/3f7502706207faf50dc71ffc524af3f1 to your computer and use it in GitHub Desktop.
Simple command to show your IP and nothing else on MacOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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