关机
halt -p
init 0
poweroff
重启
reboot
init 6
echo:
echo "hello\n"
echo -e "hello\n"
echo -n "hello"
echo ",world"
# echo默认不开启转义,需要使用-e开启转义
# echo默认自动换行,使用-n可以阻止换行
配置环境变量:
查看环境变量:
- env | grep PATH
- echo $PATH
1> 直接在当前会话中使用export,清除变量使用 unset TEST_PATH
2> 写入配置文件~/.bashrc:
export TEST_PATH=/root/test/sh_scripts/
export PATH=$PAT