zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    11.变分推断
    10.高斯混合模型GMM
    9.EM 算法
    8.指数族分布
    7.概率图模型(表示/推断/学习)
    6.核方法
    二分查找
    2.3 数据结构---数组(连续)
    C#开发Windows服务的基础代码
    C#与C++之间类型的对应{转}
  • 原文地址:https://www.cnblogs.com/gambler/p/11888577.html
Copyright © 2011-2022 走看看