请SOC高手解答一下------------about UNIX system
登录 | 论坛导航 -> 华新鲜事 -> 求学狮城 | 本帖共有 7 楼,当前显示第 3 楼 : 从楼主开始阅读 : 本帖树形列表 : 返回上一页
作者:Flying (等级:18 - 华新水车,发帖:16849) 发表:2004-07-04 22:00:11  3楼 
Try to understand the permission system:
Basic file permissions on Unix-like systems usually consist of 3 digits. The first digit refers to the permission of the user who owns the file; the second refers to that of the group that the owner is in; the third refers to that of all the other users in the system.

Each of these digits is represented in octals. Therefore, you have 3 bits in each digit (for details about octals refer to any standard text on numerics and/or introductory digital logic/computer science). The first bit in each digit refers to "r" (read) permission; the second refers to "write" (w) permission; the third refers to "x" (execute) permission. [There are more complications when the seldom used (by normal users) "sticky bit," etc. is involve. I'll not go into details of those.]

Alternatively to the above 3-digit representation, you can actually use more easily memorized parameters for chmod. The format of this alternative is x1=y1,x2=y2,...

Where x's is a combination of u, g, or o, referring to "user," "group," and "others," respectively. Y's can be a combination of r, w, or x, referring to "read," "write," and "execute." The equality sign '=' there can be substituted with '+' or '-' if you just wanna add additional permission or remove permission on the file.

For example, you can use
chmod u=rwx,go=rx file
to do the same thing as
chmod 755 file
does.

For your original question, the command to use should actually by
chmod +rx file
While adds execute permission for all of u, g, and o.
Flying @way 吳穎暉
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表

本帖共有 7 楼,当前显示第 3 楼,本文还有 N-1 层楼,要不你试试看:点击此处阅读更多 >>



请登录后回复:帐号   密码