美文网首页
1-Linux常用命令

1-Linux常用命令

作者: Guoyubo | 来源:发表于2018-09-10 15:50 被阅读0次
    查看Linux系统版本等信息

    lsb_release -a
    如果提示-bash: lsb_release: command not found
    解决方法:yum install redhat-lsb -y

    image
    参考:https://blog.csdn.net/fox_wayen/article/details/80642718
    查看系统cpu内核信息 lscpu
    图片.png

    端口相关


    查看所有端口tcp、udp端口开放情况

    netstat -ntpl (TCP类型的端口)
    netstat -nupl (UDP类型的端口)

    -a 表示所有
    -n 表示不查询dns
    -t 表示tcp协议
    -u 表示udp协议
    -p 表示查询占用的程序
    -l 表示查询正在监听的程序

    image
    查看某端口的占用情况

    netstat -nap | grep 3306 //这个表示查找处于监听状态的,端口号为3306的进程

    image
    防火墙,开启端口

    iptables -I INPUT -p tcp --dport 80 -j ACCEPT #开启80端口
    iptables save #保存配置
    iptables restart #重启服务

    查看Linux系统版本等信息

    lsb_release -a
    如果提示-bash: lsb_release: command not found
    解决方法:yum install redhat-lsb -y

    image

    文件相关


    查找某文件或文件夹位置

    find /root/etc -name aaa.bb*

    查看当前目录全路径

    pwd

    相关文章

      网友评论

          本文标题:1-Linux常用命令

          本文链接:https://www.haomeiwen.com/subject/hivsgftx.html