请SOC高手解答一下------------about UNIX system
登录 | 论坛导航 -> 华新鲜事 -> 求学狮城 | 本帖共有 7 楼,分 1 页, 当前显示第 1 页 : 本帖树形列表 : 刷新 : 返回上一页
<<始页  [1]  末页>>
作者:newater (等级:2 - 初出茅庐,发帖:104) 发表:2004-07-04 12:51:40  楼主  关注此帖
请SOC高手解答一下------------about UNIX system
how to put a file under SoC unix home directory with execute permission
and read permission?Thanks!
之乎者也
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
作者:va (等级:1 - 微不足道,发帖:71) 发表:2004-07-04 14:42:53  2楼
chmod 755 <filename>
read the manual of chmod for further info.
man chmod
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
作者: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.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
作者:newater (等级:2 - 初出茅庐,发帖:104) 发表:2004-07-05 10:06:05  4楼
谢谢,还有一点
怎么从那个命令行指定只有那一个文件的读和可执行性被改。你的那个命令看起来是把所有的文件的属性都改了,是吗?

欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
作者:Flying (等级:18 - 华新水车,发帖:16849) 发表:2004-07-05 10:52:16  5楼
谢谢,还有一点怎么从那个命令行指定只有那一个文件的读和可执行性被改。你的那个命令看起来是把所有的文件的属性都改了,是吗?
put the file's name at the command line!
chmod operations files

operations can be the digits or the acronyms.

files can be a list of files whose permissions are to be changed.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
作者:Flying (等级:18 - 华新水车,发帖:16849) 发表:2004-07-05 10:52:35  6楼
谢谢,还有一点怎么从那个命令行指定只有那一个文件的读和可执行性被改。你的那个命令看起来是把所有的文件的属性都改了,是吗?
BTW...
always make use of man pages first:
man chmod
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
作者:newater (等级:2 - 初出茅庐,发帖:104) 发表:2004-07-05 11:48:47  7楼
put the file's name at the command line!chmod operations files operations can be the digits or the acronyms. files can be a list of files whose permissions are to be changed.
thank you very much!
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
论坛导航 -> 华新鲜事 -> 求学狮城 | 返回上一页 | 本主题共有 7 篇文章,分 1 页, 当前显示第 1 页 | 回到顶部
<<始页  [1]  末页>>

请登录后回复:帐号   密码