1、查看操作系统信息
cat /etc/redhat-release
![查看操作系统](https://images.shenmazong.com/blog/f26f54ba-06d4-45c5-8a89-1c586a106a1d.png)
2、查看内存大小以及使用情况
free -h
![free](https://images.shenmazong.com/blog/e1ff4079-60da-46be-b884-1477eefb30a7.png)
3、查看磁盘空间以及使用情况
df -h
4、如何查看CPU的使用情况
top
![df](https://images.shenmazong.com/blog/affa9086-464b-41dd-8a47-a6b7fbc92535.png)
5、查看jar是否运行
ps aux|grep java
# 或者
ps aux|grep server-1907-seckill-0.0.1-SNAPSHOT.jar
![图片alt](https://images.shenmazong.com/blog/22018128-8663-4271-bbb5-e414a550bca7.png)
![图片alt](https://images.shenmazong.com/blog/b1400640-f8d0-4b64-98db-d96f29fbcaae.png)
6、查看本地端口是否被占用
netstat -ntlp|grep 3306
#
netstat -nat|grep 3306
![图片alt](https://images.shenmazong.com/blog/2b3f579f-32b2-4114-ad8b-6dd87d68badf.png)
7、如何查看日志文件
# 1、全部查看
cat user.log
# 2、分页查看
more user.log
# 3、分页查看
less user.log
# 4、看日志最后n行
tail -10 user.log
tail -20 user.log|grep count
# 5、全文查看日志
vi user.log
# 6、实时查看日志
tail -f user.log
8、在linux后台运行jar包
nohup java -jar server-homo-safe-1.0.0.jar > safe.log 2>1 &