📄 day1_2.html
字号:
<html>
<!-- #BeginTemplate "/Templates/backend.dwt" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
a:link { color: blue; text-decoration: none}
a:visited { color: purple; text-decoration: none}
a:hover { color: #CC0033; text-decoration: underline}
.smallfont { font-family: "宋体"; font-size: 9pt; line-height: 12pt}
-->
</style>
<!-- #BeginEditable "doctitle" -->
<title>CGI入门教程</title>
<!-- #EndEditable -->
</head>
<body topmargin="1" leftmargin="2">
<p><span class="smallfont"><!-- #BeginEditable "content" --></span></p>
<p><span class="smallfont"><b>CGI入门教程</b></span></p>
<p><span class="smallfont"><font color="#FF0000">第一页</font> <a href="day1_1.html">Unix环境</a><br>
<font color="#FF0000">第二页</font> chmod命令<br>
<font color="#FF0000">第三页</font> <a href="day1_3.html">定位Perl和sendmail</a></span></p>
<p><span class="smallfont">[第1天][<a href="day2_1.html">第2天</a>][<a
href="day3_1.html">第3天</a>][<a href="day4_1.html">第4天</a>][<a href="day5_1.html">第5天</a>][<a
href="day6_1.html">第6天</a>][<a href="../perl.htm">返回</a>]</span></p>
<p><span class="smallfont"> </span></p>
<p><span class="smallfont"><b>第二页:chmod命令</b></span></p>
<p><span class="smallfont">创建CGI程序时,需要改变其访问权限以便能从网页中执行之。我们用chmod命令实现这个目的。chmod命令有两个参数
- 谁拥有权限和他们将拥有哪些权限。</span></p>
<p><span class="smallfont">1.谁拥有权限?</span></p>
<p><span class="smallfont">有三类不同的权限:User、Group和Others - 用字母u、g和o表示。字母'a'表示所有类别。</span></p>
<p><span class="smallfont">2.可以拥有什么权限?</span></p>
<p><span class="smallfont">有3种类型的权限:Read、Write和eXecute,用字母r、w和x表示。</span></p>
<p><span class="smallfont">权限通过等号赋予(=r、或=rw、或=rx),或者通过加号(+r或+rwx)或减号(-w或-rwx)。</span></p>
<p><span class="smallfont">3.如何敲入命令?</span></p>
<p><span class="smallfont">对于大多数CGI程序,我想让所有人都有读和执行的权限,但没有写的权限,因此没有人可以删除或编辑我的程序。下面是最常见的命令:</span></p>
<p><span class="smallfont">chmod a+rx filename.cgi </span></p>
<p><span class="smallfont">表示让所有人有读和执行的权限。当我创建一个文件时,我拥有完全的读、写和执行权限,但其他人没有任何权限。这个命令让所有人可以运行我的程序。</span></p>
<p><span class="smallfont">在myfolder文件夹中试试这个例子:</span>
<ol>
<li><span class="smallfont">入ls -l然后按回车。显示出关于practice.txt的很多信息,包括大小、拥有者和最后保存的日期。</span></li>
<li><span class="smallfont">观察访问权限,可能是这样:rwx------或rw-r--r--或rw-r-----,前3个指明user权限(读、写、执行)。然后的三个是group权限(无),最后的三个为other权限(无)。</span></li>
<li><span class="smallfont">敲入chmod a+rx practice.txt然后按回车 -
为所有类别增加读和执行权限。</span></li>
<li><span class="smallfont">敲入ls -l然后按回车 - 这时显示的权限为rwxr-xr-x,指明拥有者仍然拥有所有权限,group和others有读和执行权限,但没有写的权限。</span></li>
<li><span class="smallfont">敲入chmod go-x practice.txt然后按回车。</span></li>
<li><span class="smallfont">敲入ls -l然后回车 - 现在的权限为rwxr--r--,指明拥有者仍有完全的权限,group和others只有读的权限。</span></li>
</ol>
<p><span class="smallfont">删除myfolder文件夹</span>
<ol>
<li><span class="smallfont">敲入rm practice.txt然后按回车。</span></li>
<li><span class="smallfont">敲入cd ..</span></li>
<li><span class="smallfont">敲入rmdir myfolder <a href="day1_3.html">>></a></span></li>
</ol>
</body>
<!-- #EndTemplate -->
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -