以CentOS为例,收集并梳理Linux系统常用的命令。
- 查看目录:ls -lA
- 杀某个进程:pkill 进程名称
- 解压缩:tar zxvf Python-3.8.10.tgz
- 复制文件夹:cp -r source_folder destination_folder
服务(Service)管理相关的命令:
- 启动服务:systemctl start httpd.service、service httpd start
- 停止服务:systemctl stop httpd.service、service httpd stop
- 重启服务:service httpd restart、systemctl restart httpd.service
- 设置服务自启动:systemctl enable httpd.service
- 关闭服务自启动:systemctl disable httpd.service
- 检查服务状态:systemctl status httpd.service
- 显示所有已启动服务:systemctl list-units – -type=service