Skip to content

Instantly share code, notes, and snippets.

@shirkey
Created December 8, 2012 04:28
Show Gist options
  • Save shirkey/4238621 to your computer and use it in GitHub Desktop.
Save shirkey/4238621 to your computer and use it in GitHub Desktop.
Copy local IP addresses from shell to X clipboard buffer (requires xsel package)
alias pbcopy='xsel --clipboard --input'
function ip {
IP=$(ifconfig | grep 'inet' | grep -v '127.0.0.1' | awk '{print $2}' | cut -c 6-)
echo $IP
echo $IP | pbcopy
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment