• Linux 常用命令


     # 查看系统版本

    uname -a
    cat /proc/version
    cat /etc/redhat-release

    # 查看当前目录文件大小

    du --max-depth=1 -h
    du -sh

    # 更新时区

    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

    # 查看端口信息

    fuser JmDiService.log
    netstat -ntlp
    netstat -anp | grep kubelet

    # 查找文件

    find . -name "*.yaml"
    grep -iR "Certificate" *.*

    # 设置主机名

    hostnamectl set-hostname k8s-master
    curl -i localhost

    # 查看系统日志

    journalctl -fu kubelet
    tail -f /var/log/messages

    # 释放缓存空间

    echo 1 > /proc/sys/vm/drop_caches
    0:是系统默认值,默认情况下表示不释放内存,由操作系统自动管理
    1:释放页缓存 2:释放dentries和inodes 3:释放所有缓存

    # 替换文件

    sed -i "s/153/218/g" /etc/hosts
    # 批量替换文件
    for cfg in `ls | grep .conf`; \
    do echo ========$cfg========;\
    sed -i "s/server_old/server_new/g" $cfg;\
    cat $cfg;\
    done

    # 查看gpu型号

    lspci |grep VGA
  • 相关阅读:
    ES6 import、export的写法
    不带分号可能会引起出错的情况
    npm传参技巧
    深度优先遍历和广度优先遍历
    WebGL的shader
    web component
    页面的beforeunload和unload的事件应用
    暴搜
    子集树与排列树
    概率论
  • 原文地址:https://www.cnblogs.com/leozhanggg/p/16660730.html
Copyright © 2020-2023  润新知