Skip to content

Instantly share code, notes, and snippets.

@nikuuchi
Created June 18, 2013 05:10
Show Gist options
  • Save nikuuchi/5802790 to your computer and use it in GitHub Desktop.
Save nikuuchi/5802790 to your computer and use it in GitHub Desktop.
ifconfigからipアドレスを切り出して表示
#!/bin/bash
ifconfig eth0 |grep inet | head -1 | awk '{print $1}' | sed -e 's/.*://'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment