查看系统信息
uname -a
显示所有LSB相关的信息
lsb_release -a
注:LSB(全称:Linux Standards Base)Linux标准库,是一套核心标准,它保证了LINUX发行版同LINUX应用程序之间的良好结合。
也可以通过redhat-release查看release版本信息
cat /etc/redhat-release
也可以直接查看centos版本
rpm -q centos-release
也可以通过uname命令查看主机名
uname -n
vi /etc/hosts
查看硬盘使用情况
df -h
监控系统,查看cpu内存使用情况
top
查看当前用户历史命令:
history
清楚历史命令:
history -c
关机:shutdown -h now
重启:shutdown -r now
重启:reboot
可能出在的一些问题:
1.执行lsb_release -a时提示:-bash: lsb_release: command not found时,
直接安装lsb_release:
2.没有ifconfig命令时提示-bash: ifconfig: command not found
直接安装直接安装net-tools.x86_64:
yum -y install net-tools.x86_64
3.使用yum时提示:cannot find a valid baseurl for repo:base/7/x86_64
解决方法:
第一步,打开ifcfg-eno16777736(网络配置文件,名称不固定,使用ifconfig时就可以看到)文件,将ONBOOT=no,改为ONBOOT=yes。
vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
第二步,重启网卡
service network restart