2021年9月6日 星期一

How to get IP by command? (Linux)

 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].*

2021年2月1日 星期一

env: bash\r: No such file or directory

 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

(TOP)Temp for soulin only

123