zoukankan      html  css  js  c++  java
  • linux基础命令-chgrp/chown/chomd

    chgrp 改变所属用户组

    要被改变的组名必须要在/etc/group文件内存在才行;

    chgrp [-R]   dirname/filename

    -R:进行递归的持续更改,连同子目录下的所有文件、目录都更新为新的用户组

    chown 改变文件所有者

    如果要连目录下的的所有子目录或文件 都同时更改文件所有者的话,直接加上-R参数即可

    chown  [-R]  账号名称                   文件或目录

    chown [-R]   账号名称组名          文件或目录

    chown [-R]  账号名称.组名           文件或目录

    chmod  改变权限

    数字类型改变文件权限

    [root@host01 tmp]# ll
    total 4
    drwxr-xr-x. 2 root root 4096 Aug 22 06:11 foo
    [root@host01 tmp]# chmod 000  foo/
    [root@host01 tmp]# ls
    foo
    [root@host01 tmp]# ll
    total 4
    d---------. 2 root root 4096 Aug 22 06:11 foo
    [root@host01 tmp]# chmod 777 foo/
    [root@host01 tmp]# ll
    total 4
    drwxrwxrwx. 2 root root 4096 Aug 22 06:11 foo
    [root@host01 tmp]# chmod 641 foo/
    [root@host01 tmp]# ls
    foo
    [root@host01 tmp]# ll
    total 4
    drw-r----x. 2 root root 4096 Aug 22 06:11 foo
    [root@host01 tmp]# chmod 755 foo/
    [root@host01 tmp]# ll
    total 4
    drwxr-xr-x. 2 root root 4096 Aug 22 06:11 foo
    [root@host01 tmp]# 

    符号类型改变文件权限

    [root@host01 tmp]# chmod  u=rwx,g=rw,o=rw  /tmp/foo/
    [root@host01 tmp]# ll
    total 4
    drwxrw-rw-. 2 root root 4096 Aug 22 06:11 foo
    [root@host01 tmp]# chmod  u=rx,g+x,o-rw  /tmp/foo/
    [root@host01 tmp]# ll
    total 4
    dr-xrwx---. 2 root root 4096 Aug 22 06:11 foo
    [root@host01 tmp]# chmod  ugo=rw  /tmp/foo/
    [root@host01 tmp]# l
    -bash: l: command not found
    [root@host01 tmp]# ll
    total 4
    drw-rw-rw-. 2 root root 4096 Aug 22 06:11 foo
    [root@host01 tmp]# chmod  ug=rw,o-rw  /tmp/foo/
    [root@host01 tmp]# ll
    total 4
    drw-rw----. 2 root root 4096 Aug 22 06:11 foo
    [root@host01 tmp]# 

                

  • 相关阅读:
    Java多线程总结之线程安全队列Queue
    Android模拟器Genymotion使用详解
    Failed to resolve:com.android.support:appcompat-v7:报错处理
    第一次使用Android Studio时你应该知道的一切配置
    sdk manager 打不开
    Android app设置全屏模式
    Android设备与外接U盘实现数据读取操作
    IIS相关优化
    集群、负载均衡、分布式
    docker启动
  • 原文地址:https://www.cnblogs.com/me80/p/7407048.html
Copyright © 2011-2022 走看看