How to get IP by command? (Linux)
Ubuntu:
ip addr show | grep -o 'inet [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' | grep -o [0-9].*
Centos:
ifconfig | grep -o 'inet [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' | grep -o [0-9].*
How to get IP by command? (Linux)
env: bash\r: No such file or directory
When you execute script file, you got error "env: bash\r: No such file or directory"
Fix it by follow command
#sed $'s/\r$//' ./install.sh > ./install.new.sh
#./install.new.sh