⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node29.html

📁 linux管理操作指南!大家看看就知道!很不错的!无解压密码!
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>Two kinds of devices</TITLE>
<META NAME="description" CONTENT="Two kinds of devices">
<META NAME="keywords" CONTENT="sag">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="sag.css" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/sag.css">
</HEAD>
<BODY LANG="EN" >
 <A NAME="tex2html660" HREF="node30.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node30.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/next_motif.gif"></A> <A NAME="tex2html658" HREF="node28.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node28.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/up_motif.gif"></A> <A NAME="tex2html652" HREF="node28.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node28.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/previous_motif.gif"></A> <A NAME="tex2html662" HREF="node1.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/contents_motif.gif"></A> <A NAME="tex2html663" HREF="node108.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node108.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html661" HREF="node30.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node30.html">Hard disks</A>
<B>Up:</B> <A NAME="tex2html659" HREF="node28.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node28.html">Using Disks and Other </A>
<B> Previous:</B> <A NAME="tex2html653" HREF="node28.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node28.html">Using Disks and Other </A>
<BR> <P>
<H1><A NAME="SECTION00510000000000000000">2种设备</A></H1>
<P>
UNIX及Linux,识别2类设备:随机存取的块设备(如磁盘)和字符设备(如磁带和串行线),
有些是串行的,有些是随机存取的。文件系统支持的每种看来是个<b>设备文件</b>。
当读写设备文件时,数据与设备联系。这样没有必要为存取设备编制特别的程序(程序不直接获取中断或读取串口),
例如,发送文件到打印机,只需:
		<BLOCKQUOTE> <TT>
<code>$</code> <I>cat filename &gt; /dev/lp1</I> <BR> 
<code>$</code>
		</TT></BLOCKQUOTE>
文件内容就被打印了(当然,文件必须是打印机能理解的格式)。当然,因为不应该让多人同时cat文件到同一打印机,
一般用特定的程序发送文件去打印(通常是<tt>lpr</tt><A NAME="1437">&#160;</A>)。
这个程序能确保同时只有一个文件被打印,并自动在完成后发送下一个。多数设备有类似需要。实际上,
根本很少需要关心设备文件。
<P>
因为设备被视为文件系统中的文件(在<tt>/dev</tt><A NAME="1439">&#160;</A>目录中),很容易看到存在哪些设备文件,
使用<tt>ls</tt><A NAME="1441">&#160;</A>或其他的适当的命令即可。
在<tt>ls -l</tt><A NAME="1443">&#160;</A>的输出中,第一列包含文件类型和权限。例如,查看我系统上的一个串行设备:
		<BLOCKQUOTE> <TT>
<code>$</code> <I>ls -l /dev/cua0</I> <BR> 
<code>crw-rw-rw-   1 root     uucp       5,  64 Nov 30  1993 /dev/cua0</code> <BR> 
<code>$</code> 
		</TT></BLOCKQUOTE>
第一列第一个字符,即<TT>crw-rw-rw-</TT>中的<TT>c</TT>告诉用户文件的种类,这是一个字符设备。
一般文件的第一个字符是"<TT>-</TT>",目录是"<TT>d</TT>",块设备是"<TT>b</TT>";
更多的信息见<tt>ls</tt><A NAME="1445">&#160;</A> man页。
<P>
注意即使设备没有安装,一般所有设备文件都存在。因此有<tt>/dev/sda</tt><A NAME="1447">&#160;</A>文件
并不意味着你真的有个SCSI硬盘。有所有的设备文件使安装程序更简单,也易于增加新硬件(无须再为产生新设备的设备文件找出正确的参数)。
<P>
<HR><A NAME="tex2html660" HREF="node30.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node30.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/next_motif.gif"></A> <A NAME="tex2html658" HREF="node28.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node28.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/up_motif.gif"></A> <A NAME="tex2html652" HREF="node28.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node28.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/previous_motif.gif"></A> <A NAME="tex2html662" HREF="node1.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/contents_motif.gif"></A> <A NAME="tex2html663" HREF="node108.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node108.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html661" HREF="node30.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node30.html">Hard disks</A>
<B>Up:</B> <A NAME="tex2html659" HREF="node28.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node28.html">Using Disks and Other </A>
<B> Previous:</B> <A NAME="tex2html653" HREF="node28.html" tppabs="http://linux.ccpi.gov.cn/Linux/linuxadmin/node28.html">Using Disks and Other </A>
<P><ADDRESS>
<I>Lars Wirzenius <BR>
Sun Jun 29 13:31:22 EEST 1997</I>
</ADDRESS>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -