• linux常用命令


    参考文档:https://blog.csdn.net/qq_23329167/article/details/83856430

    I、后台执行并且打印日志

    #这种如果ssh退出了,运行也跟着退出
    命令脚本 > log(输出文件) 2>&1 &
    # 因此可以添加nohup,永远执行下去
    nohup command > log 2>&1 &

     2、查看后台运行的进程

    jobs

     3、查看剩余空间

    #查看磁盘空间
    df -h

    #查看文件目录空间
    du -h --max-depth=1

    #查看所有文件大小
    du -sh *

     4、查看系统所有进程

    ps

    ps -aux

     5、端口占用

    netstat -anp
    telnet xxx.xxx.xxx port
    curl xxx.xxx.xxx:port
    wget xxx.xxx.xxx:port

     6、防火墙相关命令

    查看防火墙状态: systemctl status firewalld.service
    绿的running表示防火墙开启
    执行关闭命令: systemctl stop firewalld.service
    再次执行查看防火墙命令:systemctl status firewalld.service
    执行开机禁用防火墙自启命令  : systemctl disable firewalld.service
    启动:systemctl start firewalld.service
    防火墙随系统开启启动  : systemctl enable firewalld.service

     7、实时查看log日志

    tail -f xx.log

    8、zip压缩和解压缩

    #压缩
    zip -r file 
    #解压缩
    unzip file

    9、清除日志

    #四种方式
    >/logs/file.log
    
    cat /dev/null >/logs/file.log
    
    echo  "">/logs/file.log
    
    :>/logs/file.log
  • 相关阅读:
    Pycharm如何自动换行
    Android逆向基础
    动态调试ELF文件Crackme
    用Hash 算法给payload瘦身
    010 editor手写pe文件
    win脱壳_压缩壳_aspack
    WannaCrypt0r分析报告
    JVM内存分区
    java设计模式(模板方法模式)
    es6
  • 原文地址:https://www.cnblogs.com/gambler/p/11888577.html
Copyright © 2020-2023  润新知