zoukankan      html  css  js  c++  java
  • Linux常用命令

    1.解压

    tar -zxvf /home/images.tar.gz -C /specific dir       //解压到指定目录
    tar –xvf file.tar     //解压 tar包 
    tar -xjvf file.tar.bz2       //解压 tar.bz2
    tar –xZvf file.tar.Z     //解压tar.Z   
    

    2.yum安装
    安装lrzsz

    yum -y install lrzsz 
    

    3.远程拷贝

    scp [参数] [原路径] [目标路径]
      scp local_file remote_username@remote_ip:remote_file
    

    4.安装 example.rpm 包并在安装过程中显示正在安装的文件信息及安装进度

    rpm -ivh example.rpm
    

    5.需要卸载的安装包

    rpm -e
    

    6.RPM 查询操作

    rpm -q
      附加查询命令:
      a 查询所有已经安装的包以下两个附加命令用于查询安装包的信息;
     
      eg: rpm -qa | grep tomcat8 查看tomcat8是否被安装;
    

    MySQL相关

    1.登录

    mysql -u root -p
    

    2.远程授权登录

    给特定IP授权
      GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.100' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
    给任意IP授权
      GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
    

    3.显示编码

    show variables like '%character%';
    

    4.修改字符集为utf8(修改/etc/my.cnf)

    [mysqld]
      character_set_server=utf8
      init_connect='SET NAMES utf8'
    

    5.重启MySQL服务

    systemctl restart mysqld
    

    6.修改密码

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword';
      或
      set password for 'root'@'localhost'=password('yourpassword');
    

    防火墙相关(centos7)

    1.启动

    systemctl start firewalld
    

    2.停止

    systemctl stop firewalld
    

    3.禁用

    systemctl disable firewalld
    

    4.打开端口

      打开3306端口
      firewall-cmd --add-port=3306/tcp --permanent
      
    

    5.显示状态

     firewall-cmd --state
    
    

    6.更新防火墙规则

    firewall-cmd --reload
    或者
    firewall-cmd --complete-reload
    
    

    docker相关

    1.创建网络

      创建网络docker_gwbridge
       docker network create --subnet 172.21.0.0/16 
                             --gateway 172.21.0.1 
                             --opt com.docker.network.bridge.name=docker_gwbridge 
    			             --opt com.docker.network.bridge.enable_icc=false 
    			             docker_gwbridge
        或
      创建网络 yournetname
    	docker network create yournetname --subnet 172.21.0.0/16 
    	                                  --gateway 172.21.0.1
    

    2.重启docker

        systemctl daemon-reload  
        systemctl restart docker.service
      
    
  • 相关阅读:
    ASP.NET MVC 几种 Filter 的执行过程源码解析
    C#中的线程二(BeginInvoke和Invoke)
    C#中的线程一(委托中的异步)
    C#比较dynamic和Dictionary性能
    C#微信公众平台开发—高级群发接口
    js 关闭浏览器
    切图神器 --- Assistor
    切图 -- cutterman
    mac上用teamviewer远程windows输入问题
    A quick introduction to HTML
  • 原文地址:https://www.cnblogs.com/flythinking/p/8419911.html
Copyright © 2011-2022 走看看