请SOC高手解答一下------------about UNIX systemhow to put a file under SoC unix home directory with execute permission
and read permission?Thanks![newater (7-4 12:51, Long long ago)]
[ 传统版 |
sForum ][登录后回复]1楼
chmod 755 <filename>read the manual of chmod for further info.
man chmod[va (7-4 14:42, Long long ago)]
[ 传统版 |
sForum ][登录后回复]2楼
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 (7-4 22:00, Long long ago)]
[ 传统版 |
sForum ][登录后回复]3楼
谢谢,还有一点怎么从那个命令行指定只有那一个文件的读和可执行性被改。你的那个命令看起来是把所有的文件的属性都改了,是吗?
[newater (7-5 10:06, Long long ago)]
[ 传统版 |
sForum ][登录后回复]4楼
(引用 newater:谢谢,还有一点怎么从那个命令行指定只有那一个文件的读和可执行性被改。你的那个命令看起来是把所有的文件的属性都改了,是吗?
)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.[Flying (7-5 10:52, Long long ago)]
[ 传统版 |
sForum ][登录后回复]5楼
(引用 newater:谢谢,还有一点怎么从那个命令行指定只有那一个文件的读和可执行性被改。你的那个命令看起来是把所有的文件的属性都改了,是吗?
)BTW...always make use of man pages first:
man chmod[Flying (7-5 10:52, Long long ago)]
[ 传统版 |
sForum ][登录后回复]6楼
(引用 Flying:put the file's name at the command line!chmod operations files operations can be the digits or the acronyms. files can be a li...)thank you very much![newater (7-5 11:48, Long long ago)] [ 传统版 | sForum ][登录后回复]7楼