一、磁盘管理
1、查看磁盘容量、使用情况
Windows:“我的电脑” 查看
Linux:df -hT
2、查看文件占用容量
Windows:右键点击文件->属性
Linux:du -h [文件名]
二、网络管理
1、修改主机名
Windows:右击“此电脑”->属性 或者 控制面板 ->系统 查看修改计算机名称
Linux:
hostnamectl set-hostname [计算机名]
或者修改/etc/hostname文件
显示主机名 hostname 完整查看 hostnamectl status
想要修改命令行界面的主机名需要重新启动bash界面 exec bash
可以使用hostname -I查看ip
2、网络查看
Windows:
命令 ipconfig
控制面板->网络与共享中心->查看网络详情
Linux: ip addr show ipconfig
3、修改IP地址
Windows:控制面板->网络与共享中心->查看网络属性 设置静态ip
Linux:
Vim /etc/sysconfig/network/ifcfg-<interface>
配置静态网址
BOOTPROTO='static'
IPADDR='192.168.3.22'
NETMASK='255.255.255.0'
GATEWAY='192.168.3.1'
配置动态网址
BOOTPROTO='dhcp'
STARTMODE='auto'
ZONE=public
4、查看网络连接、端口
Windows:资源监视器 或者 netstat -ano
Linux:ss -antup
三、进程管理
Windows:
查看进程:tasklist 或者 资源管理器->网络
结束进程:任务管理器-> 进程 ->结束任务
Linux:
查看进程:ps -ef
结束进程 kill [PID号]
四、服务管理
Windows:
系统服务管理:任务管理器->服务
Linux:
查看服务:systemctl
列出所有服务 systemctl list-unit-files
显示某个服务的状态 systemctl status [服务名]
停止服务 systemctl stop [服务名]
启动服务 systemctl start [服务名]
重启服务 systemctl restart [服务名]
开机自启动服务 systemctl enable [服务名]
重启系统 systemctl rebot
关闭系统 systemctl poweroff
五、防火墙管理
Windows:
控制面板->防火墙
Linux:
使用systemctl来对防火墙服务 firewalld.service启动关闭 如:systemctl start firewalld.service
使用firewall-cmd命令来对防火墙进行操作:
firewall-cmd --get-services 显示所有服务列表
firewall-cmd --list-services 允许所有服务列表
firewall-cmd --get-active-zones 查看当前活动的区域
firewall-cmd --zone=zone-name --add-service=service-name 添加服务到区域
firewall-cmd --zone=zone-name --remove-service=service-name 移出服务到区域