:w 保存文件但不退出vi
:w file 将修改另外保存到file中,不退出vi
:w! 强制保存,不推出vi
:wq 保存文件并退出vi
:wq! 强制保存文件,并退出vi
q: 不保存文件,退出vi
:q! 不保存文件,强制退出vi
:e! 放弃所有修改,从上次保存文件开始再编辑
zip -r ./a.zip ./* 压缩当前目录下所有文件
chmod -R 777 file (file文件夹底下所有文件777权限)
sudo chown cabox:cabox -R file (更改file所属权限)
sudo chown apache:apache -R Application
查询硬盘时间
yum install smartmontools
smartctl --all /dev/sda
Linux关闭防火墙
centos 7:
systemctl stop firewalld.service #停止
systemctl disable firewalld.service #禁用
之前的版本:
service iptables stop #停止
1.首先查看防火墙状态:
service iptables status
2.永久性生效,重启后不会复原
开启: chkconfig iptables on
关闭: chkconfig iptables off
即时生效,重启后复原
开启: service iptables start
关闭: service iptables stop
3.设置后重启: reboot
最新微语