Linux常用命令

stopped进程查看

ps -e j | grep T

mysql服务启动

service mysqld status

下载文件

wget -c 下载地址

配置阿里云镜像地址

https://yq.aliyun.com/articles/704987

安装redis5.x

https://blog.csdn.net/qq_22067469/article/details/83817825

安装mysql8.x

https://blog.csdn.net/danykk/article/details/80137223

卸载mysql

yum remove mysql-community-server
rpm -qa |grep mysql
yum remove ..

查看服务

netstat -nlpt

解压

tar -zxvf ..

查看rpm安装

rpm -qa|grep -i mysql

查看tomcat日志

cd usr/local/tomcat5/logs
tail -f catalina.out

tail -300f xxx.log | grep "userId"

赋予执行权限

chmod 755

创建文件

touch [文件名]

查看端口

ps -aux | grep tomcat

关闭端口号

iptables -A OUTPUT -ptcp --dport 端口号-j DROP

打开端口号

iptables -A INPUT -ptcp --dport 端口号-j ACCEPT

保存设置

service iptables save

查看某端口占用的线程的pid

netstat -nlp |grep :9181

后台运行jar

nohup java -jar [jar包地址] > [日志地址] >&1 &

防火墙

1.查看已开放的端口(默认不开放任何端口)
firewall-cmd --list-ports
2.开启80端口
firewall-cmd --zone=public(作用域) --add-port=80/tcp(端口和访问类型) --permanent(永久生效)
3.重启防火墙
firewall-cmd --reload
4.停止防火墙
systemctl stop firewalld.service
5.禁止防火墙开机启动
systemctl disable firewalld.service
6.删除
firewall-cmd --zone=public --remove-port=80/tcp --permanent

你可能感兴趣的:(Linux常用命令)