
田同学使用的系统是CentOS 7,因此总结的Linux命令主要针对CentOS 7,并将持续更新常用命令。
文件相关
<code>解压 tar -xf </code>
<code>压缩 tar -zcvf test.tar.gz ./test/ </code>
<code>查找文件 find / -name nginx.conf</code>
<code>文件赋权 chmod -R 777 文件读写权限</code>
防火墙
<code>查看防火墙状态 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</code>运维
<code>查看内存占用前五的进程 ps auxw|sort -rn -k4|head -5 查看前一百行日志 tail -fn 100 nohup.log vi末行 shift + g 查看当前目录下文件夹大小 du -h --max-depth=1 查看运行端口 netstat -nlp|grep 8888</code>
部署
<code>jar包启动 nohup java -Dfile.encoding=utf-8 -jar 0923.jar>nohup.log 2>&1 &</code>
<code>启动:sudo systemctl start nginx 停止服务:sudo systemctl restart nginx 重载服务:sudo systemctl reload nginx</code>
以上就是Centos常用命令总结的详细内容,更多请关注php中文网其它相关文章!
                        
                        每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
                Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号