查看端口
netstat -ntlp
查看防火墙开放端口
iptables -L -n
查看java进程
ps -ef|grep java
卸载java
rpm -qa | grep java | xargs rpm -e --nodeps
iptables 开放端口
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 8080 -j ACCEPT
mysql开启远程
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456'
查看防火墙
systemctl status firewalld.service
关闭防火墙
systemctl stop firewalld.service
启动防火墙
systemctl start firewalld.service
开机启动防火墙
systemctl enable firewalld.service
卸载java
rpm -qa | grep java | xargs rpm -e --nodeps
rpm方式安装
rpm -ivh xxxx.rpm
redis 关闭快照 错误停止
config set stop-writes-on-bgsave-error no
后台启动Jar 无日志
nohup java -jar xxx.jar >/usr/local/temp.txt &
设置时区为上海
timedatectl set-timezone Asia/Shanghai
硬盘和系统时间同步
hwclock --hctosys
保存时钟
clock -w
linux基本环境变量
export PATH=/bin:/usr/bin:$PATH