Linux命令:chmod

https://baijiahao.baidu.com/s?id=1616750933810368135&wfr=spider&for=pc

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.
With --reference, change the mode of each FILE to that of RFILE. -c, --changes like verbose but report only when a change is made
-f, --silent, --quiet suppress most error messages
-v, --verbose output a diagnostic for every file processed
--no-preserve-root do not treat '/' specially (the default)
--preserve-root fail to operate recursively on '/'
--reference=RFILE use RFILE's mode instead of MODE values
-R, --recursive change files and directories recursively
--help display this help and exit
--version output version information and exit Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+'. GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
For complete documentation, run: info coreutils 'chmod invocation'

man chmod

 CHMOD()                                                                            User Commands                                                                            CHMOD()

 NAME
chmod - change file mode bits SYNOPSIS
chmod [OPTION]... MODE[,MODE]... FILE...
chmod [OPTION]... OCTAL-MODE FILE...
chmod [OPTION]... --reference=RFILE FILE... DESCRIPTION
This manual page documents the GNU version of chmod. chmod changes the file mode bits of each given file according to mode, which can be either a symbolic representation of
changes to make, or an octal number representing the bit pattern for the new mode bits. The format of a symbolic mode is [ugoa...][[+-=][perms...]...], where perms is either zero or more letters from the set rwxXst, or a single letter from the set ugo. Multiple
symbolic modes can be given, separated by commas. A combination of the letters ugoa controls which users' access to the file will be changed: the user who owns it (u), other users in the file's group (g), other users not in
the file's group (o), or all users (a). If none of these are given, the effect is as if a were given, but bits that are set in the umask are not affected. The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and
causes unmentioned bits to be removed except that a directory's unmentioned set user and group ID bits are not affected. The letters rwxXst select file mode bits for the affected users: read (r), write (w), execute (or search for directories) (x), execute/search only if the file is a directory
or already has execute permission for some user (X), set user or group ID on execution (s), restricted deletion flag or sticky bit (t). Instead of one or more of these let‐
ters, you can specify exactly one of the letters ugo: the permissions granted to the user who owns the file (u), the permissions granted to other users who are members of the
file's group (g), and the permissions granted to users that are in neither of the two preceding categories (o). A numeric mode is from one to four octal digits (-), derived by adding up the bits with values , , and . Omitted digits are assumed to be leading zeros. The first
digit selects the set user ID () and set group ID () and restricted deletion or sticky () attributes. The second digit selects permissions for the user who owns the file:
read (), write (), and execute (); the third selects permissions for other users in the file's group, with the same values; and the fourth for other users not in the
file's group, with the same values. chmod never changes the permissions of symbolic links; the chmod system call cannot change their permissions. This is not a problem since the permissions of symbolic links
are never used. However, for each symbolic link listed on the command line, chmod changes the permissions of the pointed-to file. In contrast, chmod ignores symbolic links
encountered during recursive directory traversals. SETUID AND SETGID BITS
chmod clears the set-group-ID bit of a regular file if the file's group ID does not match the user's effective group ID or one of the user's supplementary group IDs, unless
the user has appropriate privileges. Additional restrictions may cause the set-user-ID and set-group-ID bits of MODE or RFILE to be ignored. This behavior depends on the
policy and functionality of the underlying chmod system call. When in doubt, check the underlying system behavior. chmod preserves a directory's set-user-ID and set-group-ID bits unless you explicitly specify otherwise. You can set or clear the bits with symbolic modes like u+s and g-s,
and you can set (but not clear) the bits with a numeric mode. RESTRICTED DELETION FLAG OR STICKY BIT
The restricted deletion flag or sticky bit is a single bit, whose interpretation depends on the file type. For directories, it prevents unprivileged users from removing or
renaming a file in the directory unless they own the file or the directory; this is called the restricted deletion flag for the directory, and is commonly found on world-
writable directories like /tmp. For regular files on some older systems, the bit saves the program's text image on the swap device so it will load more quickly when run;
this is called the sticky bit. OPTIONS
Change the mode of each FILE to MODE. With --reference, change the mode of each FILE to that of RFILE. -c, --changes
like verbose but report only when a change is made -f, --silent, --quiet
suppress most error messages -v, --verbose
output a diagnostic for every file processed --no-preserve-root
do not treat '/' specially (the default) --preserve-root
fail to operate recursively on '/' --reference=RFILE
use RFILE's mode instead of MODE values -R, --recursive
change files and directories recursively --help display this help and exit --version
output version information and exit Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+'. GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report chmod translation bugs to <http://translationproject.org/team/> AUTHOR
Written by David MacKenzie and Jim Meyering. COPYRIGHT
Copyright © Free Software Foundation, Inc. License GPLv3+: GNU GPL version or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
chmod() The full documentation for chmod is maintained as a Texinfo manual. If the info and chmod programs are properly installed at your site, the command info coreutils 'chmod invocation' should give you access to the complete manual. GNU coreutils 8.22 October CHMOD()

Linux命令:chown的更多相关文章

  1. Linux 命令 - chown: 更改文件的所有者和所属群组

    chown 命令用来更改文件或者目录的所有者和所属群组.使用这个命令需要超级用户的权限. 命令格式 chown [OPTION]... [OWNER][:[GROUP]] FILE... chown ...

  2. linux命令chown和chmod什么区别

    chown一般用来 更改属主.也就是文件所属用户.chmod功能要比chown要强大.可更改文件所有属性和权限.只有管理员账户才有权限用此命令. chown 是修改文件的所有者(owner),和所属组 ...

  3. 每天一个linux命令:chown

    1.命令简介         chown(Change owner) 用来改变某个文件或目录的所有者和所属的组,该命令可以向某个用户授权,使该用户变成指定文件的所有者或者改变文件所属的组.用户可以是用 ...

  4. linux命令: chown命令

    chown将指定文件的拥有者改为指定的用户或组,用户可以是用户名或者用户ID:组可以是组名或者组ID:文件是以空格分开的要改变权限的文件列表,支持通配符.系统管理员经常使用chown命令,在将文件拷贝 ...

  5. Linux 命令 -- chown

    chown命令改变某个文件或目录的所有者和所属的组,该命令可以向某个用户授权,使该用户变成指定文件的所有者或者改变文件所属的组.用户可以是用户或者是用户D,用户组可以是组名或组id.文件名可以使由空格 ...

  6. linux命令chown修改文件所有权

      Changing User Ownership To apply appropriate permissions, the first thing to consider is ownership ...

  7. linux 命令 chown, cp $

    文件拷贝命令: sudo cp  /xxx/XXX    $HOME/ 改权限: sudo  chwon $(id -u): $(id -g)  $HOME/admin.conf 加入环境变量: ex ...

  8. Linux命令:修改文件权限命令chmod、chgrp、chown详解

    Linux系统中的每个文件和目录都有访问许可权限,用它来确定谁可以通过何种方式对文件和目录进行访问和操作. 文件或目录的访问权 限分为只读,只写和可执行三种.以文件为例,只读权限表示只允许读其内容,而 ...

  9. linux命令之chown命令

    发布:JB01   来源:脚本学堂     [大 中 小] 本文介绍下,linux系统中用于文件与目录权限管理的命令 chown命令的用法,chown将指定文件的拥有者改为指定的用户或组.有需要的朋友 ...

随机推荐

  1. [UE4]工程设置:自动捕获鼠标、通过代码设置鼠标显示隐藏、输入模式、编译时自动保存

    一.在4.20版本中运行游戏,在没有进行任何设置的情况下,游戏不会自动捕获鼠标,游戏不会接受输入,需要手动点一下游戏界面才行.如果要跟老版本一样运行游戏自动捕获鼠标,需要进行设置 二.也可以通过代码的 ...

  2. eclipse调试的时候怎么后退?

    原文转载至:https://blog.csdn.net/qq_21262611/article/details/52121270 个人分类: myeclipse   前些天和同事交流调试技巧时,知道了 ...

  3. numpy.ravel() vs numpy.flatten()

    首先声明两者所要实现的功能是一致的(将多维数组降为一维),两者的区别在于返回拷贝(copy)还是返回视图(view),numpy.flatten()返回一份拷贝,对拷贝所做的修改不会影响(reflec ...

  4. but was actually of type 'com.sun.proxy.$Proxy101' 注入问题

    最近在用springboot搭建项目框架时,遇到了如下错误,查询了一番,原来是没有引入spring框架的aop包导致: 问题: ERROR o.s.test.context.TestContextMa ...

  5. Java开发各层对象专用名词含义 PO,VO,DAO,BO,DTO,POJO, BYO,Entity,JavaBean,JavaBeans

    Java的几种名词(PO,VO,DAO,BO,POJO)解释 PO:persistant object 持久对象.可以看成是与数据库中的表相映射的java对象.最简单的PO就是对应数据库中某个表中的一 ...

  6. Spring AOP详解和实现方式

    一.什么是AOP AOP(Aspect Oriented Programming),即面向切面编程,可以说是OOP(Object Oriented Programming,面向对象编程)的补充和完善. ...

  7. winfrom 窗体控件实现二级联动

    ComboBox绑定数据源时触发SelectedIndexChanged事件的处理办法 事件,而这个时候用户并没有选择内容,其SelectedValue也不是对应字段的值.那么时写在SelectedI ...

  8. hive中sql使用英文分号

    hql只要遇见分号则认识是语句的EOF,所以对于分号,需要用“\“转义. 例如: insert overwrite table test_json_map select '{"account ...

  9. mongod 安装,增删改查

    SQL - MySQL Oracel DB2 sybase MSSQLMySQL : PHP > LAMPMySQL - 关系型数据库  - 语言学习成本高user_infoid  name   ...

  10. 傅立叶变换系列(五)快速傅立叶变换(FFT)

    说明: 傅里叶级数.傅里叶变换.离散傅里叶变换.短时傅里叶变换...这些理解和应用都非常难,网上的文章有两个极端:“Esay”  Or  “Boring”!如果单独看一两篇文章就弄懂傅里叶,那说明你真 ...