查看shell:echo ${SHELL}
查看CPU:lscpu
查看内存:free -h
查看硬盘:lsblk
查看网卡:ip a
查看Linux内核版本:uname -r
查看Linux版本:
1.cat /etc/redhat-release
2.cat /etc/os-release
设置主机名:hostname name
#hostname panda
关机
1.init 0
2.poweroff
3.shutdown -h now
临时关闭图形界面:init 3
显示提示符格式:echo $PS1
修改提示符格式范例:(重启失效)
PS1="[\e[1;41;33m][\u@\h \W]\$[\e[0m]"
PS1="[\e[1;33m][\u@\h \W]\KaTeX parse error: Undefined control sequence: \[ at position 1: \̲[̲\e[0m\]"
![在这里插…后面有空格,不然报错)
echo ‘PS1="\e[2;49;33m[\u@\h \W]$ \e[m"’ > /etc/profile.d/ps1.sh