Linux文件或目录的读,写,执行权限
来源:互联网 发布:物业台账软件 编辑:程序博客网 时间:2024/05/22 10:30
快速理解Linux文件的权限,查看
Permissions, important and tricky!
Unix permissions concern who can read a file or directory, write to it, and execute it. Permissions are granted or withheld with a magic 3-digit number. The three digits correspond to the owner (you); the group (?); and the world (everyone else).
Think of each digit as a sum:
execute permission | = 1 | |
write permission | = 2 | |
write and execute (1+2) | = 3 | |
read permission | = 4 | |
read and execute (4+1) | = 5 | |
read and write (4+2) | = 6 | |
read, write and execute (4+2+1) | = 7 |
Add the number value of the permissions you want to grant each group to make a three digit number, one digit each for the owner, the group, and the world. Here are some useful combinations. Try to figure them out!
修改方式1:以绝对方式改变权限
chmod 600 {filespec}You can read and write; the world can't. Good for files.
chmod 700 {filespec}You can read, write, and execute; the world can't. Good for scripts.
chmod 644 {filespec}You can read and write; the world can only read. Good for web pages.
chmod 755 {filespec}You can read, write, and execute; the world can read and execute. Good for programs you want to share, and your
Permissions, another way(修改方式2:以符号模式改变权限(在原来基础上增加添加定义的权限))
You can also change file permissions with letters:
u | g | a | |
r | w | x |
chmod u+rw {filespec}Give yourself read and write permission
chmod u+x {filespec}Give yourself execute permission.
chmod a+rw {filespec}Give read and write permission to everyone.
系统管理员经常使用chown命令,以便将文件拷贝到另一个用户的目录下以后,让该用户拥有使用该文件的权限。
图4
[who] [操作符号] [mode] 操作对象 who可以是下述字母中的任一个或它们的组合: u 表 示用户(user),即文件或目录的所有者。 g 表示同组(group)用户,即与文件属主有相同组ID的所有用户。 o 表示其它(others)用户。 a 表示所有(all)用户,它是系统默认值。 操作符号可以是下述符号: + 添加某个权限。 - 取消某个权限。 = 赋予给定权限并取消其他所有权限(如果有的话)。 mode所表示的权限可用下述字母的任意组合: r 表示可读。 w 表示可写。 x 表示可执行。 X 表示只有目标文件对某些用户是可执行的,或者该 目标文件是目录时才追加x (可执行)属性。 s 在文件执行时把进程的属主或组ID置为该文件的文件 属主。方式“u+s”设置文件的用户ID位, “g+s”设置组ID位。 t 保存程序的文本到交换设备上。 u 与文件属主拥有一样的权限。 g 拥有与文件属主同组用户一样的权限。 o 与其它用户拥有一样的权限。 |
Permissions, important and tricky!
Unix permissions concern who can read a file or directory, write to it, and execute it. Permissions are granted or withheld with a magic 3-digit number. The three digits correspond to the owner (you); the group (?); and the world (everyone else).
Think of each digit as a sum:
execute permission | = 1 | |
write permission | = 2 | |
write and execute (1+2) | = 3 | |
read permission | = 4 | |
read and execute (4+1) | = 5 | |
read and write (4+2) | = 6 | |
read, write and execute (4+2+1) | = 7 |
Add the number value of the permissions you want to grant each group to make a three digit number, one digit each for the owner, the group, and the world. Here are some useful combinations. Try to figure them out!
修改方式1:以绝对方式改变权限
chmod 600 {filespec}You can read and write; the world can't. Good for files.
chmod 700 {filespec}You can read, write, and execute; the world can't. Good for scripts.
chmod 644 {filespec}You can read and write; the world can only read. Good for web pages.
chmod 755 {filespec}You can read, write, and execute; the world can read and execute. Good for programs you want to share, and your
Permissions, another way(修改方式2:以符号模式改变权限(在原来基础上增加添加定义的权限))
You can also change file permissions with letters:
u | g | a | |
r | w | x |
chmod u+rw {filespec}Give yourself read and write permission
chmod u+x {filespec}Give yourself execute permission.
chmod a+rw {filespec}Give read and write permission to everyone.
系统管理员经常使用chown命令,以便将文件拷贝到另一个用户的目录下以后,让该用户拥有使用该文件的权限。
图4
[who] [操作符号] [mode] 操作对象 who可以是下述字母中的任一个或它们的组合: u 表 示用户(user),即文件或目录的所有者。 g 表示同组(group)用户,即与文件属主有相同组ID的所有用户。 o 表示其它(others)用户。 a 表示所有(all)用户,它是系统默认值。 操作符号可以是下述符号: + 添加某个权限。 - 取消某个权限。 = 赋予给定权限并取消其他所有权限(如果有的话)。 mode所表示的权限可用下述字母的任意组合: r 表示可读。 w 表示可写。 x 表示可执行。 X 表示只有目标文件对某些用户是可执行的,或者该 目标文件是目录时才追加x (可执行)属性。 s 在文件执行时把进程的属主或组ID置为该文件的文件 属主。方式“u+s”设置文件的用户ID位, “g+s”设置组ID位。 t 保存程序的文本到交换设备上。 u 与文件属主拥有一样的权限。 g 拥有与文件属主同组用户一样的权限。 o 与其它用户拥有一样的权限。 |
- Linux文件或目录的读,写,执行权限 .
- Linux文件或目录的读,写,执行权限
- Linux文件或目录的读,写,执行权限
- Linux文件或目录的读,写,执行权限
- Linux文件或目录的读,写,执行权限
- Linux目录的读、写和执行权限的解析
- LINUX目录的读、写、执行权限的具体含义
- Linux目录或文件的权限
- Linux文件读,写,执行三种权限的说明
- 文件或目录的权限
- Linux目录的执行权限
- Linux改变文件或目录的访问权限命令
- Linux改变文件或目录的访问权限命令
- Linux改变文件或目录的访问权限命令
- Linux改变文件或目录的访问权限命令
- Linux改变文件或目录的访问权限相关命令
- 修改LINUX目录或文件的权限和所有权详解
- 修改LINUX目录或文件的权限和所有权详解
- 详解 java 定时任务
- ecshop红包显示N/A,ecshop红包不显示
- 控件ChartControl的完美示例
- channelArtlist嵌套
- 类型强制转换 And 判断DataRow非空…
- Linux文件或目录的读,写,执行权限
- convertView setOnTouchListener 监听不到 touch up,move等 事件
- SQL中游标的使用--遍历数据逐行更…
- UL标签的padding与margin默认值 40px
- 诡异的Group by函数
- dedearclist 调用文章内容方法
- 4、关于String类的split()方法和append()方法
- SQL 自定义函数实例
- dede list调用文章内容方法