信息发布→ 登录 注册 退出

Centos常用命令总结

发布时间:2025-07-14

点击量:

田同学使用的系统是CentOS 7,因此总结的Linux命令主要针对CentOS 7,并将持续更新常用命令。

文件相关

解压 tar -xf 
压缩 tar -zcvf test.tar.gz ./test/ 
查找文件 find / -name nginx.conf
文件赋权 chmod -R 777 文件读写权限

防火墙

查看防火墙状态 systemctl status firewalld
查看开放防火墙端口 firewall-cmd --list-all
打开3306端口 firewall-cmd --zone=public --add-port=3306/tcp --permanent 
    –zone #作用域
    –add-port=80/tcp #添加端口,格式为:端口/通讯协议
    –permanent #永久生效,没有此参数重启后失效
重置防火墙 firewall-cmd --reload

运维

查看内存占用前五的进程 ps auxw|sort -rn -k4|head -5 
查看前一百行日志 tail -fn 100 nohup.log 
vi末行 shift + g 
查看当前目录下文件夹大小 du -h --max-depth=1 
查看运行端口 netstat -nlp|grep 8888

部署

jar包启动 nohup java -Dfile.encoding=utf-8 -jar 0923.jar>nohup.log 2>&1 &

nginx

启动:sudo systemctl start nginx
停止服务:sudo systemctl restart nginx
重载服务:sudo systemctl reload nginx
标签:# 重启  # firewall  # firewalld  # zone  # list  # 目录下  # 通讯协议  # 前五  # 格式为  # linux  # 并将  # 内存占用  # linux命令  # 作用域  # ai  # nginx  # centos  
在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!