• 7/5linux命令(整理中)


    1、函数命令高于内置命令:
    fucnction cd () { echo 123; }
    cd
    123
    取消CD命令:
    unset cd


    2、read命令:
    read -p 'pls input your hostname:' name
    #echo $name
    取name值:echo $name

    3、函数使用:

    # function test() { hostnamectl set-hostname www;hostname; } 必须有; 隔开;{}两端必须有空格

    hostnamectl set-hostname www

    4、source a.sh 没有执行权限也能运行;

    5、用户改组:

    Linux修改用户所在组方法
    强行设置某个用户所在组
    usermod -g 用户组 用户名
    把某个用户改为 group(s)
    usermod -G 用户组 用户名
    把用户添加进入某个组(s),注意:原来的用户组还存在
    usermod -a -G 用户组 用户名

    6、改ip

    ifconfig ens33 192.168.16.48/24 

    7、改默认网关:route add default gw 192.168.2.254 netmask 255.255.255.0
    route -n

    8、查看软件包

    which ifconfig
    /usr/sbin/ifconfig
    rpm -qf /usr/sbin/ifconfig
    net-tools-2.0-0.17.20131004git.el7.x86_64

    9、除了PING之外需要的MAC

    arping -I enss 192.168.2.152 有IP跟MAC
    10、查看防火墙状态:sudo ufw status

    11、NFS启动及状态查看、挂载:

    service rpcbind restart
    service nfs-kernel-server restart

    systemctl status rpcbind
    systemctl status nfs-kernel-server

    exportfs
    showmount -e
    showmount -a 看几个挂载了;

    mount 192.168.16.147:/share /opt/nfs_folder


    systemctl enable nfs-server.service(centos)设置开机启动;

    cat /etc/exports
    /share 192.168.3.1.0/24(rw,sync,fsid=0)

  • 相关阅读:
    python爬取糗事百科段子
    python爬虫-韩寒新浪博客博文
    python-函数
    Python-列表
    Linux学习笔记001——win下安装Linux虚拟机
    python爬虫-正则表达式
    IIS使用十大原则,(IIS过期时间,IIS缓存设置) 【转载】
    在mysql 中两种锁定问题
    php 迭代器与和生成器
    DBCP连接池使用问题
  • 原文地址:https://www.cnblogs.com/santizhou/p/7119866.html
Copyright © 2020-2023  润新知