zoukankan      html  css  js  c++  java
  • chmod

    0表示没有权限,1表示可执行权限,2表示可写权限,4表示可读权限
    数字与字符对应关系如下:
    r=4,w=2,x=1
    若要rwx属性则4+2+1=7
    若要rw-属性则4+2=6;
    若要r-x属性则4+1=5
    命令:
    chmod 751 file 
    说明:给file的属主分配读、写、执行(7)的权限,给file的所在组分配读、执行(5)的权限,给其他用户分配执行(1)的权限
    常用 chmod 755 file

    r读 w写 x执行   a所有用户(默认) +增加权限 -删除权限

    给所有用户添加可执行的权限 chmod a+x filename 

    chmod --help
    Usage: chmod [OPTION]... MODE[,MODE]... FILE...
      or:  chmod [OPTION]... OCTAL-MODE FILE...
      or:  chmod [OPTION]... --reference=RFILE FILE...
    Change the mode of each FILE to MODE.
    
      -c, --changes           like verbose but report only when a change is made
          --no-preserve-root  do not treat `/' specially (the default)
          --preserve-root     fail to operate recursively on `/'
      -f, --silent, --quiet   suppress most error messages
      -v, --verbose           output a diagnostic for every file processed
          --reference=RFILE   use RFILE's mode instead of MODE values
      -R, --recursive         change files and directories recursively   chmod -Rf /usr/bin/fuck
          --help     display this help and exit
          --version  output version information and exit
    
    Each MODE is of the form `[ugoa]*([-+=]([rwxXst]*|[ugo]))+'.
    
    Report bugs to <bug-coreutils@gnu.org>.
    

    chmod -R 755  dirname   给目录dirname及其子目录所有文件授权755

    chmod +x * 给当前目录下所有文件授可执行权限

  • 相关阅读:
    Soap1.1和Soap1.2的区别
    常用开源软件许可协议简介
    Web优化之Javascript Compressor
    Web优化之YaHoo Web优化的14条法则
    Installing Cygwin on Windows 7 And Configure SSH
    Different Between Cygwin And MinGw
    xml读取异常Invalid byte 1 of 1-byte UTF-8 sequence
    JAVA事务系列三:JTA事务
    JAVA事务系列二:JDBC事务
    帅才将才慧才
  • 原文地址:https://www.cnblogs.com/rusking/p/3624450.html
Copyright © 2011-2022 走看看