📄 index.html
字号:
<HTML><HEAD><TITLE>linux知识宝库</TITLE>
<META http-equiv=content-type content="text/html; charset=gb2312">
<META content=linuxtips,linux,php,mysql,apache name=keywords>
<STYLE type=text/css>A:link {
COLOR: #666666; TEXT-DECORATION: underline
}
A:active {
COLOR: #666666; TEXT-DECORATION: underline
}
A:visited {
COLOR: #666666; TEXT-DECORATION: underline
}
A:hover {
COLOR: #708090; TEXT-DECORATION: none
}
.articletitle {
FONT-WEIGHT: bold; FONT-SIZE: 18px; COLOR: #335588; LINE-HEIGHT: 26px; FONT-FAMILY: trebuchet ms, arial, verdana, helvetica, sans-serif; TEXT-DECORATION: none
}
INPUT {
FONT-WEIGHT: normal; FONT-SIZE: 11px; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
TEXTAREA {
FONT-WEIGHT: normal; FONT-SIZE: 11px; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
.bginput {
BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #999999 1px solid; BORDER-BOTTOM: #999999 1px solid; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #f9f9f9
}
.text {
BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #cccccc 1px solid
}
SELECT {
FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: 宋体; BACKGROUND-COLOR: #ffffff
}
.firstalt {
BACKGROUND-COLOR: #eeeeee
}
.secondalt {
BACKGROUND-COLOR: #ffffff
}
.bigfont {
FONT-SIZE: 45px; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
.normalfont {
FONT-SIZE: 12px; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
.middlefont {
FONT-SIZE: 11px; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
.smallfont {
FONT-SIZE: 9px; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
.smallbold {
FONT-WEIGHT: bold; COLOR: #000000
}
.articletitle {
FONT-WEIGHT: bold; FONT-SIZE: 18px; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
.subhead {
FONT-WEIGHT: bold; FONT-SIZE: 13px; COLOR: #006699; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
#content A:link {
COLOR: #3366cc; TEXT-DECORATION: underline
}
#content A:active {
COLOR: #3366cc; TEXT-DECORATION: underline
}
#content A:visited {
COLOR: #3366cc; TEXT-DECORATION: underline
}
#content A:hover {
COLOR: #9966cc; TEXT-DECORATION: none
}
.content {
FONT-SIZE: 14px; LINE-HEIGHT: 130%; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
.titlefont {
FONT-SIZE: 12px; COLOR: #ffffff; FONT-FAMILY: verdana, arial, helvetica, sans-serif,宋体
}
.bodyline {
BORDER-RIGHT: #aebdc4 1px solid; BORDER-TOP: #aebdc4 1px solid; BORDER-LEFT: #aebdc4 1px solid; BORDER-BOTTOM: #aebdc4 1px solid; BACKGROUND-COLOR: #ffffff
}
.cattitle {
FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #000000; LETTER-SPACING: 1px
}
.tableoutline {
BORDER-RIGHT: #c4c4c4 1px solid; BORDER-TOP: #c4c4c4 1px solid; BORDER-LEFT: #c4c4c4 1px solid; BORDER-BOTTOM: #c4c4c4 1px solid
}
.root_td {
PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Verdana; HEIGHT: 22px; BACKGROUND-COLOR: #ffffff; font-color: #000000
}
.child_td {
PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-SIZE: 12px; PADDING-BOTTOM: 3px; COLOR: #000000; FONT-FAMILY: Verdana; HEIGHT: 22px; BACKGROUND-COLOR: #f5f5f5; TEXT-DECORATION: underline
}
#cattitle A:link {
COLOR: #000000; TEXT-DECORATION: none
}
#cattitle A:visited {
COLOR: #000000; TEXT-DECORATION: none
}
#cattitle A:active {
COLOR: #000000; TEXT-DECORATION: none
}
#cattitle A:hover {
COLOR: #000000; TEXT-DECORATION: none
}
</STYLE>
<SCRIPT language=JavaScript type=text/javascript>
<!--
if (parent.frames.length > 0) {
parent.location.href = self.document.location
}
function ToggleNode(nodeObject, imgObject){
if(nodeObject.style.display == '' || nodeObject.style.display == 'inline'){
nodeObject.style.display = 'none';
imgObject.src = 'images/plus.gif'/*tpa=http://www.linuxhero.com/docs/images/plus.gif*/;
}else{
nodeObject.style.display = 'inline';
imgObject.src = 'images/minus.gif'/*tpa=http://www.linuxhero.com/docs/images/minus.gif*/;
}
}
-->
</SCRIPT>
<BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 marginwidth="0"
marginheight="0">
<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=296
border=0></TD>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=76
border=0></TD>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=100
border=0></TD>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=98
border=0></TD>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=79
border=0></TD>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=103
border=0></TD>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=26
border=0></TD>
<TD><IMG height=1 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1
border=0></TD></TR>
<TR>
<TD colSpan=3><A title=linux知识宝库 href="index.html" tppabs="http://www.linuxhero.com/docs/index.html"><IMG height=83
src="images/header_r1_c1.gif" tppabs="http://www.linuxhero.com/docs/images/header_r1_c1.gif" width=472 border=0
name=header_r1_c1></A></TD>
<TD colSpan=3>
<form action="http://www.linuxhero.com/docs/search.html" method=get>
<table
style="BORDER-RIGHT: #c4c4c4 1px solid; BORDER-TOP: #c4c4c4 1px solid; BORDER-LEFT: #c4c4c4 1px solid; BORDER-BOTTOM: #c4c4c4 1px solid"
cellspacing=0 cellpadding=3 width="95%" border=0 align="center">
<tbody>
<tr>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif">
<div align=center><font class=normalfont>搜索文章:
<input type=hidden value=result name=action2>
<input type=radio checked value=title name=type>标题
<input type=radio value=content name=type>内容
<input type=image src="images/button_go.gif" tppabs="http://www.linuxhero.com/docs/images/button_go.gif" border=0 name=image2>
</font></div>
</td>
</tr>
<tr>
<td noWrap>
<div align="center">
<input maxlength=100 size=30 name=keyword2>
</div>
</td>
</tr></tbody>
</table>
</form>
</TD>
<TD rowSpan=2><IMG src="images/header_r1_c7.gif" tppabs="http://www.linuxhero.com/docs/images/header_r1_c7.gif" width=26 border=0 name=header_r1_c7></TD>
<TD><IMG height=83 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1 border=0></TD></TR>
<TR>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif"><IMG height=22
src="images/header_r2_c1.gif" tppabs="http://www.linuxhero.com/docs/images/header_r2_c1.gif" width=296 border=0
name=header_r2_c1></TD>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colSpan=5>
<DIV align=right><FONT class=normalfont>当前位置: <A href="index.html" tppabs="http://www.linuxhero.com/docs/index.html">本站首页</A>
| <A href="copyright.html" tppabs="http://www.linuxhero.com/docs/copyright.html">版权说明</A></font></DIV>
</TD>
<TD><IMG height=22 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1
border=0></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=10 cellPadding=0 width="100%" bgColor=#ffffff
border=0>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TR>
<TD vAlign=top align=middle width="60%">
<TABLE cellSpacing=0 cellPadding=0 width="100%"
background="images/back.gif" tppabs="http://www.linuxhero.com/docs/images/back.gif" border=0>
<TBODY>
<TR>
<TD vAlign=top width="80%">
<DIV align=center>
<FORM action="search.html" tppabs="http://www.linuxhero.com/docs/search.html" method=get>
</FORM>
<TABLE cellSpacing=0 cellPadding=0 width="95%"
border=0><TBODY>
<TR>
<TD background="images/bgi.gif" tppabs="http://www.linuxhero.com/docs/images/bgi.gif"
height=30></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=3 width="95%"
align=center border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%"
border=0>
<TBODY>
<TR>
<TD vAlign=top>
<p><FONT class=normalfont><B><font color="blue">一句话精彩问答</font></B></FONT>
<BR>
<FONT class=smallfont color=#ff9900>2004-04-20 11:10:14</FONT><BR>
<FONT class=normalfont>编者: 陈绪先生</FONT><br>
<font class=normalfont>来自: SUN中国工程研究院</font><BR>
</p>
<FONT class=normalfont>
<font color=red>版本更新时间:2004年10月10日</font>
<br><br>
编者按:对于Linux系统的知识而言,往往是10%的知识解决90%以上的问题,这便是本文的由来。更详细的文档,请访问<a href="javascript:if(confirm('http://www.linuxhero.com/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.linuxhero.com/'" tppabs="http://www.linuxhero.com/" target="_blank" class="postlink"><span style="font-size: 16px; line-height: normal; color: green">http://www.linuxhero.com</span></a>。
<br>
<br>
----------------------------网络无关篇--------------------------
<br>
0001 <span style="color: red;">修改主机名(bjchenxu)</span>
<br>
vi
/etc/sysconfig/network,修改HOSTNAME一行为"HOSTNAME=主机名"(没有这行?那就添加这一行吧),然后运行命令
" hostname 主机名"。一般还要修改/etc/hosts文件中的主机名。这样,无论你是否重启,主机名都修改成功。
<br>
<br>
0002 <span style="color: red;">Ret Hat Linux启动到文字界面(不启动xwindow)(bjchenxu)</span>
<br>
vi /etc/inittab
<br>
id:x:initdefault:
<br>
x=3:文本方式 x=5:图形方式
<br>
<br>
0003 <span style="color: red;">linux的自动升级更新问题(hutuworm,NetDC)</span>
<br>
对于redhat,在www.redhat.com/corp/support/errata/找到补丁,6.1以后的版本带有一个工具up2date,它能够测定哪些rpm包需要升级,然后自动从redhat的站点下载并完成安装。
<br>
升级除kernel外的rpm: up2date -u
<br>
升级包括kernel在内的rpm: up2date -u -f
<br>
<br>
由于Red Hat Network SSL证书过期,所以应在rhn_register || up2date 之前先执行一行script以更新证书:
<br>
wget -q -O - <a href="javascript:if(confirm('https://rhn.redhat.com/help/new-cert.sh \n\nThis file was not retrieved by Teleport Pro, because it is addressed using an unsupported protocol (e.g., gopher). \n\nDo you want to open it from the server?'))window.location='https://rhn.redhat.com/help/new-cert.sh'" tppabs="https://rhn.redhat.com/help/new-cert.sh" target="_blank">https://rhn.redhat.com/help/new-cert.sh</a> | /bin/bash
<br>
<br>
Debian跟别的发行版还是有很大的差别的,用Debian做服务器维护更加方便;红帽的升级其实挺麻烦的,当然,如果你交钱给红帽的话,服务是会不一样的。
<br>
Debian下升级软件:
<br>
apt-get update
<br>
apt-get upgrade
<br>
前提:配置好网络和/etc/apt/sources.list,也可以用apt-setup设置。
<br>
<br>
0004 <span style="color: red;">windows下看linux分区的软件(bjchenxu)</span>
<br>
Paragon.Ext2FS.Anywhere.2.5.rar和explore2fs-1.00-pre4.zip
<br>
<br>
0005 <span style="color: red;">mount用法(sakulagi,sxsfxx)</span>
<br>
fat32的分区 mount -o codepage=936,iocharset=cp936 /dev/hda7 /mnt/cdrom
<br>
ntfs的分区 mount -o iocharset=cp936 /dev/hda7 /mnt/cdrom
<br>
iso文件 mount -o loop /abc.iso /mnt/cdrom
<br>
软盘 mount /dev/fd0 /mnt/floppy
<br>
USB闪存 mount /dev/sda1 /mnt/cdrom
<br>
所有/etc/fstab内容 mount -a
<br>
可以指定文件格式"-t 格式", 格式可以为vfat, ext2, ext3等.
<br>
访问DVD mount -t iso9660 /dev/dvd /mnt/cdrom或mount -t udf /dev/dvd /mnt/cdrom
<br>
注意:dvd的格式一般为iso9660或udf之一
<br>
<br>
0006 <span style="color: red;">在vmware的LINUX中使用本地硬盘的FAT分区(bjchenxu)</span>
<br>
将本地的FAT分区共享,然后在VMWARE中使用SMBFS挂上。可以将如下的行放到/etc/fstab中:
<br>
//win_ip/D$ /mnt/d smbfs defaults,auto,username=win_name,password=win_pass,codepage=936,iocharest=gb2312 0 0
<br>
其中win_ip是你的windows的IP地址;
<br>
D$是你的windows里面共享的D盘的共享名;
<br>
/mnt/d是要将该分区mount到linux的目录;
<br>
win_name和win_pass是你的WINDOWS里面可以读取该分区的用户,比如你的管理员名和密码。
<br>
如果你运行了/etc/rc.d/init.d/netfs,那么在启动的时候就会自动挂载这个分区。
<br>
<br>
0007.a <span style="color: red;">删除名为-a的文件(bjchenxu)</span>
<br>
rm ./-a
<br>
rm -- -a 告诉rm这是最后一个选项,参见getopt
<br>
ls -i 列出inum,然后用find . -inum inum_of_thisfile -exec rm '{}' \;
<br>
<br>
0007.b <span style="color: red;">删除名为\a的文件(bjchenxu)</span>
<br>
rm \\a
<br>
<br>
0007.c <span style="color: red;">删除名字带的/和‘\0'文件(bjchenxu)</span>
<br>
这些字符是正常文件系统所不允许的字符,但可能在文件名中产生,如unix下的NFS文件系统在Mac系统上使用
<br>
1.解决的方法,把NFS文件系统在挂到不过滤'/'字符的系统下删除含特殊文件名的文件。
<br>
2.也可将错误文件名的目录其它文件移走,ls -id 显示含该文件目录的inum,umount 文件系统,
<br>
clri清除该目录的inum,fsck,mount,check your lost+found,rename the file in it.
<br>
最好是通过WINDOWS FTP过去就可以删除任何文件名的文件了!
<br>
<br>
0007.d <span style="color: red;">删除名字带不可见字符的文件(bjchenxu)</span>
<br>
列出文件名并转储到文件:ls -l >aaa
<br>
然后编辑文件的内容加入rm命令使其内容成为删除上述文件的格式:
<br>
vi aaa
<br>
[rm -r *******
<br>
]
<br>
把文件加上执行权限 chmod +x aaa
<br>
执行 $aaa
<br>
<br>
0007.e <span style="color: red;">删除文件大小为零的文件(bjchenxu)</span>
<br>
rm -i `find ./ -size 0`
<br>
find ./ -size 0 -exec rm {} \;
<br>
或
<br>
find ./ -size 0 | xargs rm -f &
<br>
或
<br>
for file in * #自己定义需要删除的文件类型
<br>
do
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -