• Linux常用命令


    一次性创建多个文件夹:mkdir -p /test/{1,2,3}
     
    //注册systemd服务
     
    // 列出 systemctl上所有服务
    systemctl list-unit-files | grep enabled|grep redis
    systemctl | grep running
    systemctl list-unit-files | grep enabled|grep redis|awk '{print $1}'|xargs systemctl stop
    systemctl list-unit-files | grep enabled|grep redis|awk '{print $1}'|xargs systemctl disable
    ps -ef | grep java | grep sharding| grep testcase| grep -v grep | awk '{print $2}'|xargs kill -9
    rm -fr /etc/systemd/system/zcloud_redis_*
    rm -fr /zcloud
     
     
    =============tar====================
    tar -zxf 解压

    tar -cvf jpg.tar *.jpg //将目录里所有jpg文件打包成jpg.tar 

    tar -czf jpg.tar.gz *.jpg   //将目录里所有jpg文件打包成jpg.tar后,并且将其用gzip压缩,生成一个gzip压缩过的包,命名为jpg.tar.gz

     tar -cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用bzip2压缩,生成一个bzip2压缩过的包,命名为jpg.tar.bz

    =========检查端口是否被占用=======

    netstat -an|grep 8082|grep -i listen

     ss -tulpn|grep LISTEN|grep 8082

     

    ==========查看linux系统版本=======

    cat /etc/os-release

    lsb_release -a

    hostnamectl

    ================检查端口是否使用================

    netstat -an|grep 6379|grep -i listen

    ===========递归修改文件权限===============

     chmod -R  755 test

    ==========虚拟机不能用ssh访问解决方案==============

    https://yq.aliyun.com/articles/103191 

     

    ===========查看目录的挂载点==============

    df /var/lib/

    =========关闭liux防火墙===========

    systemctl status firewalld.service systemctl stop firewalld.service

     

    ==========RPM=====================

    ====安装rpm

    rpm -ivh <package name>

    ====删除install的rpm包

    rpm -qa | grep -i <keyword>

    rpm -e <package name>

    =============查看系统位数==========

    uname -m

    arch

    ===========SCP===================

    scp -r /paasdata/o_1d92gnr8kgubab3102e6ohp1g8/python_redis_cluster_deploy.tar.gz root@192.168.20.100:/zcloud_team/zCloud-1.0.5.0-20190516/RedisV1.0.5.0/installPackage/python

     

    ==========查看用户==============

    cat /etc/passwd|grep sharding|grep testcase|awk -F: '{print $1 > "delusers.txt"}'

    ==删除用户

    cat /etc/passwd|grep sharding|grep testcase|awk -F: '{print $1}'|xargs -i userdel -fr {}

     

     

    ====查看文件夹占用的内存

    du -h -x --max-depth=1

     

     

     

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    UVA 401 回文词
    n的阶乘分解成素数幂的积
    DSSM问答匹配模型
    Enhanced LSTM for Natural Language Inference
    Bidirectional LSTM-CRF Models for Sequence Tagging
    Attention Is All You Need 学习笔记
    BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
    C++学习笔记(四)
    C++学习笔记(三)
    java学习笔记(七)
  • 原文地址:https://www.cnblogs.com/guoAIrong/p/11057848.html
Copyright © 2020-2023  润新知