Skip to content

Instantly share code, notes, and snippets.

@bubakazouba
Created January 8, 2016 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bubakazouba/72e7827eb512ec0aeeb8 to your computer and use it in GitHub Desktop.
Save bubakazouba/72e7827eb512ec0aeeb8 to your computer and use it in GitHub Desktop.
a small script that copies your local ip to clipboard and shows it in a notification
alias getlocalip="bash ~/.getlocalipscript.sh"
IP=`ifconfig | grep 'inet ' | grep -v 127.0.0.1 | awk '{print $2}'`;
echo $IP | tr -d '\n' | pbcopy;
#terminal-notifier -message "$IP" -title 'Local IP Address' #if you have terminal-notifier use this
osascript -e "display notification \"$IP\" with title \"Local IP Address\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment