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

📄 appendix-b.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
📖 第 1 页 / 共 4 页
字号:


passwd

</A></H4>



<P>For the normal user (non-superuser), no arguments are used with the

passwd 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'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's ID, then the superuser can change that user'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's ID, then that argument becomes that user's new password.

</P>



<H4><A NAME="1739_ 62">





ps

</A></H4>



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

</P>

<!-- CODE //-->

<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 //-->





<A NAME="PAGENUM-625"><P>Page 625</P></A>







<H4><A NAME="1739_ 63">





pwd

</A></H4>



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

</P>



<H4><A NAME="1739_ 64">





rm

</A></H4>



<P>rm is used to delete specified files. With the

-r option (Warning: This can be dangerous!), rm will recursively remove files. Therefore if, as root, you type the command

rm -r /, 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><A NAME="1739_ 65">





rmdir

</A></H4>



<P>rmdir removes a given empty directory; the word

empty is the key word. The syntax is simply rmdir

&lt;directory name&gt;.

</P>



<H4><A NAME="1739_ 66">





set

</A></H4>



<P>The set command is used to temporarily change an environment variable. In some shells,

the set -o vi 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

.profile. Some environment variables require an equals sign, and some, as in the example

set -o vi, do not.

</P>



<H4><A NAME="1739_ 67">





shutdown

</A></H4>



<P>One time during Star Trek: The Next Generation, Data commands the computer to &quot;Shut

down the holodeck!&quot; Unfortunately, most systems don't have voice controls, but systems can still

be shut down. This command happens to be the one to do just that. Technically, the

shutdown 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's being technical? The

shutdown command can also be used to issue a &quot;Vulcan Neck

Pinch&quot; (Ctrl+Alt+Del) and restart the system.

</P>



<H4><A NAME="1739_ 68">





su

</A></H4>



<P>su 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!),

su 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 0 (which makes a user a superuser) to log on as anyone

else without a password.

</P>



<A NAME="PAGENUM-626"><P>Page 626</P></A>







<H4><A NAME="1739_ 69">





swapoff

</A></H4>



<P>No, swapoff is not a move from Karate Kid. Instead, it is a command that stops swapping to

a file or block device.

</P>



<H4><A NAME="1739_ 70">





swapon

</A></H4>



<P>Also not from the movie Karate Kid, swapon sets the swap area to the file or block device

by path. swapoff stops swapping to the file. This command is normally done during system boot.

</P>



<H4><A NAME="1739_ 71">





tail

</A></H4>



<P>tail 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's

name enclosed in a left and right arrow (==&gt; &lt;==) before the output of each file. The default value

of 10 lines can be changed by placing a -### 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><A NAME="1739_ 72">





talk

</A></H4>



<P>The talk command is used to have a &quot;visual&quot; discussion with someone else over a

terminal. The basic idea behind this visual discussion is that your input is copied to the other

person's terminal, and the other person'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><A NAME="1739_ 73">





tar

</A></H4>



<P>tar is an archiving program designed to store and extract files from an archive file. This

tarred file (called a tar file), can be archived to any media including a tape drive and a hard drive.

The syntax of a tar command is tar &lt;action&gt;

&lt;optional functions&gt;

&lt;file(s)/directory(ies)&gt;. If the last parameter is a directory, all subdirectories under the directory are also tarred.

</P>



<H4><A NAME="1739_ 74">





umount

</A></H4>



<P>Just as the cavalry unmounts from their horses, filesystems unmount from their locations

as well. The umount 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><A NAME="1739_ 75">





unalias

</A></H4>



<P>unalias is the command to undo an alias. In the

alias command section, earlier in this appendix, I aliased

dir to be the ls command. To unalias this command, you would simply type

</P>

<!-- CODE SNIP //-->

<PRE>

unalias dir.

</PRE>

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



<A NAME="PAGENUM-627"><P>Page 627</P></A>







<H4><A NAME="1739_ 76">





unzip

</A></H4>



<P>The unzip 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 &lt;filename&gt;.

</P>



<H4><A NAME="1739_ 77">





wall

</A></H4>



<P>wall 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><A NAME="1739_ 78">





who

</A></H4>



<P>Either the who command calls an owl, which it doesn'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 who command:

</P>

<!-- CODE //-->

<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 //-->



<P>If two nonoption arguments are passed to the

who command, the command prints the entry for the user running it. Typically, this is run with the command

who am I, 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 -u 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 //-->

<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 //-->



<H4><A NAME="1739_ 79">





xhost +

</A></H4>



<P>The xhost + command allows xterms to be displayed on a system. Probably the most

common reason that a remote terminal cannot be opened is because the

xhost + command has not been run. To turn off the capability to allow

xterms, the xhost - command is used.

</P>



<H4><A NAME="1739_ 80">





xmkmf

</A></H4>



<P>The xmkmf command is used to create the

Imakefiles for X sources. It actually runs the

imake command with a set of arguments.

</P>



<A NAME="PAGENUM-628"><P>Page 628</P></A>



<H4><A NAME="1739_ 81">





xset

</A></H4>



<P>The xset command sets some of the options in an X Window session. You can use this

option to set your bell (xset b &lt;volume&gt;

&lt;frequency&gt; &lt;duration in milliseconds&gt;), your

mouse speed (xset m &lt;acceleration&gt;

&lt;threshold&gt;), and many others.

</P>



<H4><A NAME="1739_ 82">





zip

</A></H4>



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

an archive.

</P>



<H3><A NAME="1739_ 83">

Summary

</A></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><CENTER>

<a href="ewtoc.html">Table of Contents</A>

</CENTER></P>







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

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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