zoukankan      html  css  js  c++  java
  • Linux基本权限管理

    一. 文件基本权限

    1.   - 文件类型,第一个字符为-,代表是文件类型(-文件      d目录     | 软链接文件)

    2.  总共10个字符,2~10 总共9个字符,每三个字符为一组

         rw-   u所有者的权限

         r--     g所属组的权限

         r--     o其他人的权限

    3. r 读     w 写      x执行

    4. 上图中所有者为root,权限rw- 

        所属组为root, 权限为r--

        其他 权限为r--

    二、 修改权限 chmod命令

    chmod [选项] 模式  文件名

    选项 -R 递归

    模式  [ugoa][+-=][rwx]   [mode=421]

    1. chmod u+x  hello.txt

    针对hello.txt 文件,给当前用户,增加x可执行权限

    2.  chmod g+x,o+x hello.txt

    就是对所属组和其他增加写权限

    3. 删除刚才增加的权限

    命令为 chmod u-x,g-w,o-w hello.txt

    4. chmod u=rwx hello.txt

    修改当前用户的权限为rwx

    5. chomd a=rw hello.txt

    给所有人赋予rw权限

    三、权限的数字表示

    r ----   4

    w ----  2

    x ---- 1

    rwx r-x r-x

    7     5    5

    如 chmod 755 hello.txt

  • 相关阅读:
    poj 2718 Smallest Difference
    AtCoder Beginner Contest 100 2018/06/16
    aoj 0009 Prime Number
    poj 1930 Dead Fraction
    poj 3669 Meteor Shower
    aoj 0121 Seven Puzzle
    poj 2429 GCD & LCM Inverse
    aoj 0005 GCD and LCM
    aoj 0558 Cheese
    aoj 0033 玉
  • 原文地址:https://www.cnblogs.com/linlf03/p/8098131.html
Copyright © 2011-2022 走看看