Linux 系统管理
Linux 系统管理
关键词:
lsb_release
,reboot
,exit
,shutdown
,date
,mount
,umount
,ps
,kill
,systemctl
,service
,crontab
1. Linux 系统管理要点
- 查看 Linux 系统发行版本
- 使用 lsb_release(此命令适用于所有的 Linux 发行版本)
- 使用
cat /etc/redhat-release
(此方法只适合 Redhat 系的 Linux)
- 查看 CPU 信息 - 使用
cat /proc/cpuinfo
- 重新启动 Linux 操作系统 - 使用 reboot
- 退出 shell,并返回给定值 - 使用 exit
- 关闭系统 - 使用 shutdown
- 查看或设置系统时间与日期 - 使用 date
- 挂载文件系统 - 使用 mount
- 取消挂载文件系统 - 使用 umount
- 查看系统当前进程状态 - 使用 ps
- 删除当前正在运行的进程 - 使用 kill
- 启动、停止、重启、关闭、显示系统服务(Centos7),使用 systemctl
- 启动、停止、重启、关闭、显示系统服务(Centos7 以前),使用 service
- 管理需要周期性执行的任务,使用 crontab
2. 命令常见用法
2.1. lsb_release
lsb_release 不是 bash 默认命令,如果要使用,需要先安装。
安装方法:
- 执行
yum provides lsb_release
,查看支持 lsb_release 命令的包。 - 选择合适版本,执行类似这样的安装命令:
yum install -y redhat-lsb-core-4.1-27.el7.centos.1.x86_64