开关机
将数据同步写入硬盘的中的指令:sync
关机前执行 sync
命令是一个很好的习惯
reboot:现在重新启动计算机
logout:用户注销
开机启动 chkconfig | systemctl
判断是否开机启动
chkconfig iptables --list
、systemctl is-enabled nginx
设置开机启动
chkconfig iptables on|off
、systemctl enable|disable redis
进程管理 ps --help all
ps -ef | grep redis
kill -9 pid
常用的一些参数:
参数 | 说明 |
---|---|
-A, -e | all processes |
端口管理 netstat --help
常用参数
参数 | 说明 |
---|---|
-a | 表示列举所有的连接、服务器监听 |
-t | 列出所有tcp协议的服务 |
-u | 列出所有udp协议的服务 |
-n | 使用端口号来显示 |
-l | 列出所有的监听 |
-p | 列出所有服务的进程id(pid) |
一般常用: netstat -atunlp