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

📄 appendix-d.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
📖 第 1 页 / 共 4 页
字号:
tcp        0  16501 www.mk.net:www         sdlb12119.san

      net.:3148 FIN_WAIT1

root

tcp        0  16501 auth02.mk.net:www      sdlb12119.san

      net.:3188 FIN_WAIT1

root

tcp        0      1 www.anglernet.com:www  ts88.cctrap.com:1070

      SYN_RECV

root

tcp        0      1 www.anglernet.com:www  ts88.cctrap.com:1071

      SYN_RECV

root

udp        0      0 localhost:domain       *:*

udp        0      0 svr01.mk.net:domain    *:*

udp        0      0 poto.mk.net:domain     *:*

udp        0      0 stats.mk.net:domain    *:*

udp        0      0 home.mk.net:domain     *:*

udp        0      0 www.cmf.net:domain     *:*

Active UNIX domain sockets

Proto RefCnt Flags      Type            State           Path

unix  2      [ ]        SOCK_STREAM     UNCONNECTED

      1605182

unix  2      [ ]        SOCK_STREAM     UNCONNECTED

      1627039

unix  2      [ ]        SOCK_STREAM     CONNECTED

      1652605

</PRE>

<!-- END CODE //-->

<H4 ALIGN="LEFT"><A NAME="Heading50"></A><FONT COLOR="#000077"><I>passwd</I>

</FONT></H4>

<P>For the normal user (non-superuser), no arguments are used with the <TT>passwd</TT> command. The command will ask the user for the old password. Following this, the command will ask for the new password twice, to make sure it was typed correctly. The new password must be at least six characters long and must contain at least one character that is either uppercase or a nonletter. Also, the new password cannot be the same password as the one being replaced, nor can it match the user&#146;s ID (account name).</P>

<P>If the command is run by the superuser, it can be followed by either one or two arguments. If the command is followed by a single user&#146;s ID, then the superuser can change that user&#146;s password. The superuser is not bound by any of the restrictions imposed on the user. If there is an argument after the single user&#146;s ID, then that argument becomes that user&#146;s new password.</P>

<H4 ALIGN="LEFT"><A NAME="Heading51"></A><FONT COLOR="#000077"><I>ps</I>

</FONT></H4>

<P><TT>ps</TT> gives a snapshot of the current processes. An example is as follows:</P>

<!-- CODE SNIP //-->

<PRE>

svr01:/home/dpitts$ ps -ef

PID TTY STAT  TIME COMMAND

10916  p3 S     0:00 -bash TERM=vt100 HOME=/home2/dpitts

    PATH=/usr/local/bin:/us

10973  p3 R     0:00  \_ ps -ef LESSOPEN=|lesspipe.sh %s

    ignoreeof=10 HOSTNAME=s

10974  p3 S     0:00  \_ more LESSOPEN=|lesspipe.sh %s ignoreeof=10 HOSTNAME=svr

</PRE>

<!-- END CODE SNIP //-->

<H4 ALIGN="LEFT"><A NAME="Heading52"></A><FONT COLOR="#000077"><I>pwd</I>

</FONT></H4>

<P><TT>pwd</TT> prints the current working directory. It tells you what directory you are currently in.</P>

<H4 ALIGN="LEFT"><A NAME="Heading53"></A><FONT COLOR="#000077"><I>rm</I>

</FONT></H4>

<P><TT>rm</TT> is used to delete specified files. With the <TT>-r</TT> option (Warning: This can be dangerous!), <TT>rm</TT> will recursively remove files. Therefore if, as root, you type the command <TT>rm -r /</TT>, you had better have a good backup because all your files are now gone. This is a good command to use in conjunction with the find command to find files owned by a certain user or in a certain group, and delete them. By default, the rm command does not remove directories.</P>

<H4 ALIGN="LEFT"><A NAME="Heading54"></A><FONT COLOR="#000077">rmdir</FONT></H4>

<P><TT>rmdir</TT> removes a given <I>empty</I> directory; the word <I>empty</I> is the key word. The syntax is simply <TT>rmdir &lt;directory name&gt;</TT>.</P>

<H4 ALIGN="LEFT"><A NAME="Heading55"></A><FONT COLOR="#000077"><I>set</I>

</FONT></H4>

<P>The <TT>set</TT> command is used to temporarily change an environment variable. In some shells, the set <TT>-o vi</TT> command will allow you to bring back previous commands that you have in your history file. It is common to place the command in your <TT>.profile</TT>. Some environment variables require an equals sign, and some, as in the example <TT>set -o vi</TT>, do not.</P>

<H4 ALIGN="LEFT"><A NAME="Heading56"></A><FONT COLOR="#000077"><I>shutdown</I>

</FONT></H4>

<P>One time during <I>Star Trek: The Next Generation</I>, Data commands the computer to &#147;Shut down the holodeck!&#148; Unfortunately, most systems don&#146;t have voice controls, but systems can still be shut down. This command happens to be the one to do just that. Technically, the <TT>shutdown</TT> call</P>

<!-- CODE SNIP //-->

<PRE>

int shutdown(int s, int how));

</PRE>

<!-- END CODE SNIP //-->

<P>causes all or part of a full-duplex connection on a socket associated with s to be shut down, but who&#146;s being technical? The <TT>shutdown</TT> command can also be used to issue a &#147;Vulcan Neck Pinch&#148; (Ctrl&#43;Alt&#43;Del) and restart the system.</P>

<H4 ALIGN="LEFT"><A NAME="Heading57"></A><FONT COLOR="#000077"><I>su</I>

</FONT></H4>

<P><TT>su</TT> enables a user to temporarily become another user. If a user ID is not given, the computer thinks you want to be the superuser, or root. In either case, a shell is spawned that makes you the new user, complete with that user ID, group ID, and any supplemental groups of that new user. If you are not root and the user has a password (and the user should!), <TT>su</TT> prompts for a password. Root can become any user at any time without knowing passwords. Technically, the user just needs to have a user ID of <TT>0</TT> (which makes a user a superuser) to log on as anyone else without a password.</P>

<H4 ALIGN="LEFT"><A NAME="Heading58"></A><FONT COLOR="#000077"><I>swapoff</I>

</FONT></H4>

<P>No, <TT>swapoff</TT> is not a move from <I>Karate Kid</I>. Instead, it is a command that stops swapping to a file or block device.</P>

<H4 ALIGN="LEFT"><A NAME="Heading59"></A><FONT COLOR="#000077"><I>swapon</I>

</FONT></H4>

<P>Also not from the movie <I>Karate Kid</I>, <TT>swapon</TT> sets the swap area to the file or block device by path. <TT>swapoff</TT> stops swapping to the file. This command is normally done during system boot.</P>

<H4 ALIGN="LEFT"><A NAME="Heading60"></A><FONT COLOR="#000077"><I>tail</I>

</FONT></H4>

<P><TT>tail</TT> prints to standard output the last 10 lines of a given file. If no file is given, it reads from standard input. If more than one file is given, it prints a header consisting of the file&#146;s name enclosed in a left and right arrow (<TT>==&gt; &lt;==</TT>) before the output of each file. The default value of 10 lines can be changed by placing a <TT>-###</TT> in the command. The syntax for the command is</P>

<!-- CODE SNIP //-->

<PRE>

tail [-&lt;# of lines to see&gt;] [&lt;filename(s)&gt;]

</PRE>

<!-- END CODE SNIP //-->

<H4 ALIGN="LEFT"><A NAME="Heading61"></A><FONT COLOR="#000077"><I>talk</I>

</FONT></H4>

<P>The <TT>talk</TT> command is used to have a &#147;visual&#148; discussion with someone else over a terminal. The basic idea behind this visual discussion is that your input is copied to the other person&#146;s terminal, and the other person&#146;s input is copied to your terminal. Thus, both people involved in the discussion see the input for both themselves and the other person.</P>

<H4 ALIGN="LEFT"><A NAME="Heading62"></A><FONT COLOR="#000077"><I>tar</I>

</FONT></H4>

<P><TT>tar</TT> is an archiving program designed to store and extract files from an archive file. This tarred file (called a <TT>tar</TT> file), can be archived to any media including a tape drive and a hard drive. The syntax of a <TT>tar</TT> command is <TT>tar &lt;action&gt; &lt;optional functions&gt; &lt;file(s)/directory(ies)&gt;</TT>. If the last parameter is a directory, all subdirectories under the directory are also tarred.</P>

<H4 ALIGN="LEFT"><A NAME="Heading63"></A><FONT COLOR="#000077"><I>umount</I>

</FONT></H4>

<P>Just as the cavalry unmounts from their horses, filesystems unmount from their locations as well. The <TT>umount</TT> command is used to perform this action. The syntax of the command is</P>

<!-- CODE SNIP //-->

<PRE>

umount &lt;filesystem&gt;

</PRE>

<!-- END CODE SNIP //-->

<H4 ALIGN="LEFT"><A NAME="Heading64"></A><FONT COLOR="#000077"><I>unalias</I>

</FONT></H4>

<P><TT>unalias</TT> is the command to undo an alias. In the <TT>alias</TT> command section, earlier in this appendix, I aliased <TT>dir</TT> to be the <TT>ls</TT> command. To unalias this command, you would simply type <TT>unalias dir</TT>.</P>

<H4 ALIGN="LEFT"><A NAME="Heading65"></A><FONT COLOR="#000077"><I>unzip</I>

</FONT></H4>

<P>The <TT>unzip</TT> command will list, test, or extract files from a zipped archive. The default is to extract files from the archive. The basic syntax is unzip <TT>&lt;filename&gt;</TT>.</P>

<H4 ALIGN="LEFT"><A NAME="Heading66"></A><FONT COLOR="#000077"><I>wall</I>

</FONT></H4>

<P><TT>wall</TT> displays the contents of standard input on all terminals of all currently logged in users. Basically, the command writes to all terminals, hence its name. The contents of files can also be displayed. The superuser, or root, can write to the terminals of those who have chosen to deny messages or are using a program that automatically denies messages.</P>

<H4 ALIGN="LEFT"><A NAME="Heading67"></A><FONT COLOR="#000077"><I>who</I>

</FONT></H4>

<P>Either the <TT>who</TT> command calls an owl, which it doesn&#146;t, or it prints the login name, terminal type, login time, and remote hostname of each user currently logged on. The following is an example of the <TT>who</TT> command:</P>

<!-- CODE SNIP //-->

<PRE>

svr01:/home/dpitts$ who

root     ttyp0    Jul 27 11:44 (www01.mk.net)

dpitts   ttyp2    Jul 27 19:32 (d12.dialup.seane)

ehooban  ttyp3    Jul 27 11:47 (205.177.146.78)

dpitts   ttyp4    Jul 27 19:34 (d12.dialup.seane)

</PRE>

<!-- END CODE SNIP //-->

<P>If two nonoption arguments are passed to the <TT>who</TT> command, the command prints the entry for the user running it. Typically, this is run with the command <TT>who am I</TT>, but any two arguments will work; for example, the following gives information on my session:</P>

<!-- CODE SNIP //-->

<PRE>

svr01:/home/dpitts$ who who who

svr01!dpitts   ttyp2    Jul 27 19:32 (d12.dialup.seane)

</PRE>

<!-- END CODE SNIP //-->

<P>The <TT>-u</TT> option is nice if you want to see how long it has been since that session has been used, such as in the following:</P>

<!-- CODE SNIP //-->

<PRE>

svr01:/home/dpitts$ who -u

root     ttyp0    Jul 27 11:44 08:07 (www01.mk.net)

dpitts   ttyp2    Jul 27 19:32   .   (d12.dialup.seane)

ehooban  ttyp3    Jul 27 11:47 00:09 (205.177.146.78)

dpitts   ttyp4    Jul 27 19:34 00:06 (d12.dialup.seane)

</PRE>

<!-- END CODE SNIP //-->

<H4 ALIGN="LEFT"><A NAME="Heading68"></A><FONT COLOR="#000077"><I>xhost &#43;</I>

</FONT></H4>

<P>The <TT>xhost</TT> &#43; command allows xterms to be displayed on a system. Probably the most common reason that a remote terminal cannot be opened is because the <TT>xhost &#43;</TT> command has not been run. To turn off the capability to allow <TT>xterms</TT>, the <TT>xhost -</TT> command is used.</P>

<H4 ALIGN="LEFT"><A NAME="Heading69"></A><FONT COLOR="#000077"><I>xmkmf</I>

</FONT></H4>

<P>The <TT>xmkmf</TT> command is used to create the <TT>Imakefiles</TT> for X sources. It actually runs the <TT>imake</TT> command with a set of arguments.</P>

<H4 ALIGN="LEFT"><A NAME="Heading70"></A><FONT COLOR="#000077"><I>xset</I>

</FONT></H4>

<P>The <TT>xset</TT> command sets some of the options in an X Window session. You can use this option to set your bell (<TT>xset b &lt;volume&gt; &lt;frequency&gt; &lt;duration in milliseconds&gt;</TT>), your mouse speed (<TT>xset m &lt;acceleration&gt; &lt;threshold&gt;</TT>), and many others.</P>

<H4 ALIGN="LEFT"><A NAME="Heading71"></A><FONT COLOR="#000077"><I>zip</I>

</FONT></H4>

<P>The <TT>zip</TT> command will list, test, or add files to a zipped archive. The default is to add files to an archive.</P>

<H3><A NAME="Heading72"></A><FONT COLOR="#000077">Summary</FONT></H3>

<P>If you read this entire appendix, you will have noticed two things. First, I cannot count. There are about seventy commands here, not fifty as the title of the appendix states. Second, you have way too much time on your hands, and need to go out and program some drivers or something!

</P>

<P>I hope this appendix has helped you gain an understanding of some of the commands available for your use, whether you are a user, a system administrator, or just someone who wants to learn more about Red Hat Linux. I encourage you to use the man pages to find out the many details left out of this appendix. Most of the commands have arguments that can be passed to them, and, although this appendix attempts to point out a few of them, it would have taken an entire book just to go into the detail that has been provided in the man pages.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="ewtoc.html">Table of Contents</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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