Created
January 1, 2022 05:14
-
-
Save hoyangtsai/76080e46704920ba049b6fcf0e1ece36 to your computer and use it in GitHub Desktop.
#shell get local ip address #command
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
#!/bin/bash | |
IP=`ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\ -f2` | |
echo "$IP" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/8529181/which-terminal-command-to-get-just-ip-address-and-nothing-else