Try to understand the permission system:
所在版块:求学狮城 发贴时间:2004-07-04 22:00

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
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 吳穎暉
 相关帖子 我要回复↙ ↗回到正文
请SOC高手解答一下------------about UNIX system newater   (100 bytes , 525reads )
谢谢,还有一点 newater   (108 bytes , 242reads )
BTW... Flying   (45 bytes , 191reads )
put the file's name at the command line! Flying   (136 bytes , 215reads )
thank you very much! newater   (0 bytes , 185reads )
Try to understand the permission system: Flying   (1488 bytes , 251reads )
chmod 755 <filename> va   (53 bytes , 287reads )