📄 appendix-b.html
字号:
<H4><A NAME="1739_ 39">
halt
</A></H4>
<P>The halt command tells the kernel to shut down. This is a superuser-only command (you
must "be root").
</P>
<H4><A NAME="1739_ 40">
hostname
</A></H4>
<P>hostname is used to either display the current host or domain name of the system or to set
the hostname of the system—for example,
</P>
<!-- CODE SNIP //-->
<PRE>
svr01:/home/dpitts$ hostname
svr01
</PRE>
<!-- END CODE SNIP //-->
<H4><A NAME="1739_ 41">
kill
</A></H4>
<P>kill sends the specified signal to the specified process. If no signal is specified, the
TERM signal is sent. The TERM signal will kill processes that do not process the
TERM signal. For processes that do process the
TERM signal, it might be necessary to use the KILL signal because this signal
cannot be caught. The syntax for the kill command is
kill <option> <pid>, and an example is
as follows:
</P>
<!-- CODE SNIP //-->
<PRE>
svr01:/home/dpitts$kill -9 1438
</PRE>
<!-- END CODE SNIP //-->
<H4><A NAME="1739_ 42">
less
</A></H4>
<P>less is a program similar to more, but which allows backward movement in the file as well
as forward movement. less also doesn't have to read the entire input file before starting, so
with large input files it starts up faster than text editors such as vi.
</P>
<H4><A NAME="1739_ 43">
login
</A></H4>
<P>login is used when signing on to a system. It can also be used to switch from one user to
another at any time.
</P>
<H4><A NAME="1739_ 44">
logout
</A></H4>
<P>logout is used to sign off a system as the current user. If it is the only user you are logged in
as, then you are logged off the system.
</P>
<A NAME="PAGENUM-621"><P>Page 621</P></A>
<H4><A NAME="1739_ 45">
lpc
</A></H4>
<P>lpc is used by the system administrator to control the operation of the line printer system.
lpc can be used to disable or enable a printer or a printer's spooling queue, to rearrange the
order of jobs in a spooling queue, to find out the status of printers, to find out the status of the
spooling queues, and to find out the status of the printer daemons. The command can be used
for any of the printers configured in
/etc/printcap.
</P>
<H4><A NAME="1739_ 46">
lpd
</A></H4>
<P>lpd is the line printer daemon and is normally invoked at boot time from the
rc file. It makes a single pass through the
/etc/printcap file to find out about the existing printers and
prints any files left after a crash. It then uses the system calls
listen and accept to receive requests to print files in the queue, transfer files to the spooling area, display the queue, or remove
jobs from the queue.
</P>
<H4><A NAME="1739_ 47">
lpq
</A></H4>
<P>lpq examines the spooling area used by lpd for printing files on the line printer, and reports
the status of the specified jobs or all jobs associated with a user. If the command is invoked
without any arguments, the command reports on any jobs currently in the print queue.
</P>
<H4><A NAME="1739_ 48">
lpr
</A></H4>
<P>The line printer command uses a spooling daemon to print the named files when
facilities become available. If no names appear, the standard input is assumed. The following is an
example of the lpr command:
</P>
<!-- CODE SNIP //-->
<PRE>
lpr /etc/hosts
</PRE>
<!-- END CODE SNIP //-->
<H4><A NAME="1739_ 49">
ls
</A></H4>
<P>The ls command lists the contents of a directory. The format of the output is
manipulated with options. The ls command, with no options, lists all nonhidden files (a file that
begins with a dot is a hidden file) in alphabetical order, filling as many columns as will fit in the
window. Probably the most common set of options used with this command is the
-la option. The a means list all (including hidden files) files, and the
l means make the output a long listing. Here is an example of this command:
</P>
<!-- CODE //-->
<PRE>
svr01:~$ ls -la
total 35
drwxr-xr-x 7 dpitts users 1024 Jul 21 00:19 ./
drwxr-xr-x 140 root root 3072 Jul 23 14:38 ../
-rw-r--r-- 1 dpitts users 4541 Jul 23 23:33 .bash_history
-rw-r--r-- 1 dpitts users 18 Sep 16 1996 .forward
-rw-r--r-- 2 dpitts users 136 May 10 01:46 .htaccess
-rw-r--r-- 1 dpitts users 164 Dec 30 1995 .kermrc
-rw-r--r-- 1 dpitts users 34 Jun 6 1993 .less
-rw-r--r-- 1 dpitts users 114 Nov 23 1993 .lessrc
</PRE>
<!-- END CODE //-->
<A NAME="PAGENUM-622"><P>Page 622</P></A>
<!-- CODE //-->
<PRE>
-rw-r--r-- 1 dpitts users 10 Jul 20 22:32 .profile
drwxr-xr-x 2 dpitts users 1024 Dec 20 1995 .term/
drwx------ 2 dpitts users 1024 Jul 16 02:04 Mail/
drwxr-xr-x 2 dpitts users 1024 Feb 1 1996 cgi-src/
-rw-r--r-- 1 dpitts users 1643 Jul 21 00:23 hi
-rwxr-xr-x 1 dpitts users 496 Jan 3 1997 nquota*
drwxr-xr-x 2 dpitts users 1024 Jan 3 1997 passwd/
drwxrwxrwx 5 dpitts users 1024 May 14 20:29 public_html/
</PRE>
<!-- END CODE //-->
<H4><A NAME="1739_ 50">
make
</A></H4>
<P>The purpose of the make utility is to automatically determine which pieces of a large
program need to be recompiled and then to issue the commands necessary to recompile them.
</P>
<H4><A NAME="1739_ 51">
man
</A></H4>
<P>The man command is used to format and display the online manual pages. The manual
pages are the text that describes, in detail, how to use a specified command. In the following
example, I have called the man page that describes the
man pages:
</P>
<!-- CODE //-->
<PRE>
svr01:~$ man man
man(1) man(1)
NAME
man - format and display the on-line manual pages
manpath - determine user's search path for man pages
SYNOPSIS
man [-adfhktwW] [-m system] [-p string] [-C config_file]
[-M path] [-P pager] [-S section_list] [section] name ...
DESCRIPTION
man formats and displays the on-line manual pages. This
version knows about the MANPATH and PAGER environment
variables, so you can have your own set(s) of personal man
pages and choose whatever program you like to display the
formatted pages. If section is specified, man only looks
in that section of the manual. You may also specify the
order to search the sections for entries and which prepro-
cessors to run on the source files via command line
options or environment variables. If name contains a /
then it is first tried as a filename, so that you can do
</PRE>
<!-- END CODE //-->
<H4><A NAME="1739_ 52">
mesg
</A></H4>
<P>The mesg utility is run by a user to control write access others have to the terminal device
associated with the standard error output. If write access is allowed, programs such as
talk and write have permission to display messages on the terminal. Write access is allowed by default.
</P>
<H4><A NAME="1739_ 53">
mkdir
</A></H4>
<P>The mkdir command is used to make a new directory.
</P>
<A NAME="PAGENUM-623"><P>Page 623</P></A>
<H4><A NAME="1739_ 54">
mkefs
</A></H4>
<P>The mkefs command is used to make an extended filesystem. This command does not
format the new filesystem, just makes it available for use.
</P>
<H4><A NAME="1739_ 55">
mkfs
</A></H4>
<P>mkfs is used to build a Linux filesystem on a device, usually a hard disk partition. The
syntax for the command is mkfs <filesystem>, where
<filesystem> is either the device name (such
as /dev/hda1) or the mount point (for example, /,
/usr, /home) for the filesystem.
</P>
<H4><A NAME="1739_ 56">
mkswap
</A></H4>
<P>mkswap sets up a Linux swap area on a device (usually a disk partition).
</P>
<P>The device is usually of the following form:
</P>
<!-- CODE SNIP //-->
<PRE>
/dev/hda[1-8]
/dev/hdb[1-8]
/dev/sda[1-8]
/dev/sdb[1-8]
</PRE>
<!-- END CODE SNIP //-->
<H4><A NAME="1739_ 57">
more
</A></H4>
<P>more is a filter for paging through text one screen at a time. This command can only page
down through the text, as opposed to less, which can page both up and down though the text.
</P>
<H4><A NAME="1739_ 58">
mount
</A></H4>
<P>mount attaches the filesystem specified by
specialfile (which is often a device name) to the directory specified as the parameter. Only the superuser can
mount files. If the mount command is run without parameters, it lists all the currently mounted filesystems. The following is
an example of the mount command:
</P>
<!-- CODE //-->
<PRE>
svr01:/home/dpitts$ mount
/dev/hda1 on / type ext2 (rw)
/dev/hda2 on /var/spool/mail type ext2 (rw,usrquota)
/dev/hda3 on /logs type ext2 (rw,usrquota)
/dev/hdc1 on /home type ext2 (rw,usrquota)
none on /proc type proc (rw)
</PRE>
<!-- END CODE //-->
<H4><A NAME="1739_ 59">
mv
</A></H4>
<P>The mv command is used to move an object from one location to another location. If the
last argument names an existing directory, the command moves the rest of the list into that
directory. If two files are given, the command moves the first into the second. It is an error to
have more than two arguments with this command unless the last argument is a directory.
</P>
<A NAME="PAGENUM-624"><P>Page 624</P></A>
<H4><A NAME="1739_ 60">
netstat
</A></H4>
<P>netstat displays the status of network connections on either TCP, UDP, RAW, or UNIX
sockets to the system. The -r option is used to obtain information about the routing table. The
following is an example of the netstat command:
</P>
<!-- CODE //-->
<PRE>
svr01:/home/dpitts$ netstat
Active Internet connections
Proto Recv-Q Send-Q Local Address Foreign Address (State)
User
tcp 0 16501 www.mk.net:www sdlb12119.sannet.:3148 FIN_WAIT1
root
tcp 0 16501 auth02.mk.net:www sdlb12119.sannet.: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><A NAME="1739_ 61">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -