zoukankan      html  css  js  c++  java
  • Linux常用命令

    防火墙相关配置

    • 查看当前防火墙状态:
    systemctl status firewalld
    或者
    service  iptables status
    
    • 暂时关闭防火墙:
    systemctl stop firewalld
    或者
    service  iptables stop
    
    • 永久关闭防火墙:
    systemctl disable firewalld
    或者
    chkconfig iptables off
    
    • 重启防火墙:
    systemctl enable firewalld
    或者
    service iptables restart
    
    • 开机防火墙不启动态:
    systemctl disable firewalld
    

    开放/关闭端口号

    • 关闭端口号:
    iptables -A OUTPUT -p tcp --dport 端口号-j DROP
    
    • 打开端口号:
    iptables -A INPUT -ptcp --dport  端口号-j ACCEPT
    
    • 保存设置:
    service iptables save
    

    按照CPU和内存排序来查看进程

    • 按照CPU使用情况排序: 先top命令之后,按大写P
    • 按照内存使用情况排序: 先top命令之后,按大写M

    查看进程所占端口号

    ps aux|grep (任务名字)
    
    

    根据进程号码查询所占端口

    netstat –nltp|grep (进程号)
    
  • 相关阅读:
    数组
    Spring创建对象的三种方式以及创建时间
    Struts文件上传下载
    自定义拦截器
    Struts过滤器
    mybatis整合ehcache
    mybatis主键返回
    shell脚本 列出所有网卡的ip地址
    Servlet执行过程
    centos时区
  • 原文地址:https://www.cnblogs.com/YangGC/p/12217561.html
Copyright © 2011-2022 走看看