CentOS7 常用命令
压缩文件夹到文件
tar -cvf /tmp/etc.tar /etc <==仅打包,不压缩!
tar -zcvf /tmp/etc.tar.gz /etc <==打包后,以gzip 压缩
tar -jcvf /tmp/etc.tar.bz2 /etc <==打包后,以bzip2 压缩
防火墙:
systemctl start firewalld.service #停止firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
systemctlrestart iptables.service #最后重启防火墙使配置生效
systemctlenable iptables.service #设置防火墙开机启动