总结二

作者: zxhChex | 来源:发表于2019-08-05 09:15 被阅读0次

    free -h 改变单位显示内存
    lscpu
    /proc/cpuinfo
    /proc/meminfo
    uname -a 所有内核相关信息
    2.打包压缩
    tar -czvf 打包后的名.tar.gz 源文件 >> file.log
    tar -xf 包.tar.gz -C 解压到的路径
    3.日志轮转
    logroate -vf

    /etc/logroate.conf

    /path/to/file.log
    /path/to/file2.log
    {
    ……
    }
    /var/log/messagen 很重要
    4.FTP server
    vsftpd 文件传输协议
    get file
    maget file1 file2
    mirror dir
    5.包管理工具
    rpm -ivh pag.rpm 安装rpm包
    rpm -qa |grep tree 找所有安装的rpm包过滤tree
    rpm -ql tree 查看tree安装了什么文件
    rpm -qc tree 查看tree安装的配置文件
    rpm -qf file 查看这个文件属于哪个rpm包

    yum install -y tree
    yum remove tree
    /etc/yum.conf
    keepcache=1
    /etc/yum.repos.d/*.repo
    yum clean all && yum makecache

    6.计划任务
    crontab -e
    crontab -u username -e

            • /bin/bash /script.sh
              分 时 日 月 星

    7.网络基本配置
    ip a
    ip route show
    ip addr add 1.1.1.1/24 dev ens33
    BOOTPROTO=none (dhcp)
    IPADDR=
    PREFIX=24
    GATEWAY=x.x.x.1
    DNS1=114.114.114.114

    /etc/resolv.conf
    nameserver 114.114.114.114

    systemctl restart network

    centos6
    chkconf --level 3 mysqld on
    service network restart
    8.ssh
    ssh 服务器用户@服务器ip
    免密登录的前提

    1. ssh-keygen -t rsa -N ""
      2.ssh-copy-id 服务器用户@服务器ip
      -p 2222
      scp -P 2222 源文件 目标文件 (发送文件)

    9.shell
    env
    set
    export val_name
    a=$(date +%F)

    针对所有用户生效
    /etc/profile
    /etc/profile.d/*.sh
    -python.sh
    -java.sh
    /etc/bashrc

    针对当前用户生效
    ~/.bashrc


    本周

    shell 编程
    测试表达式
    正则表达式
    if
    for
    while
    case
    esac
    set
    awk
    sed
    mysql

    相关文章

      网友评论

          本文标题:总结二

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