aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/books/handbook/basics/chapter.xml
diff options
context:
space:
mode:
Diffstat (limited to 'en_US.ISO8859-1/books/handbook/basics/chapter.xml')
-rw-r--r--en_US.ISO8859-1/books/handbook/basics/chapter.xml525
1 files changed, 266 insertions, 259 deletions
diff --git a/en_US.ISO8859-1/books/handbook/basics/chapter.xml b/en_US.ISO8859-1/books/handbook/basics/chapter.xml
index 3a5544e5ed..d9dd5a98eb 100644
--- a/en_US.ISO8859-1/books/handbook/basics/chapter.xml
+++ b/en_US.ISO8859-1/books/handbook/basics/chapter.xml
@@ -57,7 +57,7 @@
</listitem>
<listitem>
- <para>What a shell is, and how to change your default login
+ <para>What a shell is, and how to change the default login
environment.</para>
</listitem>
@@ -87,10 +87,10 @@
<para>&os; can be used in various ways. One of them is typing
commands to a text terminal. A lot of the flexibility and power
- of a &unix; operating system is readily available at your hands
- when using &os; this way. This section describes what
+ of a &unix; operating system is readily available when using
+ &os; this way. This section describes what
<quote>terminals</quote> and <quote>consoles</quote> are, and
- how you can use them in &os;.</para>
+ how to use them in &os;.</para>
<sect2 id="consoles-intro">
<title>The Console</title>
@@ -144,15 +144,16 @@ login:</screen>
<screen>login:</screen>
- <para>Type the username that was configured during <link
- linkend="bsdinstall-addusers">system installation</link> and
- press <keycap>Enter</keycap>. Then enter the password
- associated with the username and press <keycap>Enter</keycap>.
- The password is <emphasis>not echoed</emphasis> for security
+ <para>Type the username that was configured during system
+ installation, as described in <xref
+ linkend="bsdinstall-addusers"/>, and press
+ <keycap>Enter</keycap>. Then enter the password associated
+ with the username and press <keycap>Enter</keycap>. The
+ password is <emphasis>not echoed</emphasis> for security
reasons.</para>
- <para>Once the correct password is input, the message of
- the day (<acronym>MOTD</acronym>) will be displayed followed
+ <para>Once the correct password is input, the message of the
+ day (<acronym>MOTD</acronym>) will be displayed followed
by a command prompt (a <literal>#</literal>,
<literal>$</literal>, or <literal>%</literal> character). You
are now logged into the &os; console and ready to try the
@@ -165,8 +166,8 @@ login:</screen>
<para>&os; can be configured to provide many virtual consoles
for inputting commands. Each virtual console has its own
login prompt and output channel, and &os; takes care of
- properly redirecting keyboard input and monitor output as you
- switch between virtual consoles.</para>
+ properly redirecting keyboard input and monitor output as
+ switching occurs between virtual consoles.</para>
<para>Special key combinations have been reserved by &os; for
switching consoles.<footnote>
@@ -228,10 +229,10 @@ ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure</programlisting>
<title>Single User Mode Console</title>
<para>A detailed description of <quote>single user mode</quote>
- can be found <link linkend="boot-singleuser">here</link>.
- There is only one console when &os; is in single user mode as
- no other virtual consoles are available in this mode. The
- settings for single user mode are found in this section of
+ can be found in <xref linkend="boot-singleuser"/>. There is
+ only one console when &os; is in single user mode as no other
+ virtual consoles are available in this mode. The settings
+ for single user mode are found in this section of
<filename>/etc/ttys</filename>:</para>
<programlisting># name getty type status comments
@@ -249,11 +250,11 @@ console none unknown off secure</programlisting>
without prompting for a password.</para>
<para><emphasis>Be careful when changing this setting to
- <literal>insecure</literal></emphasis>. If you ever
- forget the <username>root</username> password, booting into
- single user mode is still possible, but may be difficult for
- someone who is not comfortable with the &os; booting
- process.</para>
+ <literal>insecure</literal></emphasis>. If the
+ <username>root</username> password is forgotten, booting
+ into single user mode is still possible, but may be
+ difficult for someone who is not comfortable with the &os;
+ booting process.</para>
</note>
</sect2>
@@ -301,6 +302,15 @@ console none unknown off secure</programlisting>
managing requests for hardware devices, peripherals, memory, and
CPU time fairly to each user.</para>
+ <para>Much more information about user accounts is in the chapter
+ about <link linkend="users">accounts</link>. It is important to
+ understand that each person (user) who uses the computer should be
+ given their own username and password. The system keeps track
+ of the people using the computer based on this username. Since
+ it is often the case that several people are working on the same
+ project &unix; also provides groups. Several users can be placed
+ in the same group.</para>
+
<para>Because the system is capable of supporting multiple users,
everything the system manages has a set of permissions governing
who can read, write, and execute the resource. These
@@ -382,7 +392,7 @@ console none unknown off secure</programlisting>
</tgroup>
</informaltable>
<indexterm>
- <primary><command>ls</command></primary>
+ <primary>&man.ls.1;</primary>
</indexterm>
<indexterm><primary>directories</primary></indexterm>
@@ -424,10 +434,10 @@ total 530
write, and execute permissions. The executable bit for a
directory has a slightly different meaning than that of files.
When a directory is marked executable, it means it is possible
- to change into that directory using
- <application>cd</application>. This also means that it is
- possible to access the files within that directory, subject to
- the permissions on the files themselves.</para>
+ to change into that directory using &man.cd.1;. This also
+ means that it is possible to access the files within that
+ directory, subject to the permissions on the files
+ themselves.</para>
<para>In order to perform a directory listing, the read permission
must be set on the directory. In order to delete a file that
@@ -588,10 +598,9 @@ total 530
<para>In addition to file permissions, &os; supports the use of
<quote>file flags</quote>. These flags add an additional
- level of security and control over files, but not
- directories. With file flags, even
- <username>root</username> can be prevented from removing or
- altering files.</para>
+ level of security and control over files, but not directories.
+ With file flags, even <username>root</username> can be
+ prevented from removing or altering files.</para>
<para>File flags are modified using &man.chflags.1;. For
example, to enable the system undeletable flag on the file
@@ -669,7 +678,7 @@ total 530
<para>Note that a <literal>s</literal> is now part of the
permission set designated for the file owner, replacing the
executable bit. This allows utilities which need elevated
- permissions, such as <command>passwd</command>.</para>
+ permissions, such as &man.passwd.1;.</para>
<note>
<para>The <literal>nosuid</literal> &man.mount.8; option will
@@ -680,10 +689,10 @@ total 530
</note>
<para>To view this in real time, open two terminals. On
- one, start the <command>passwd</command> process as a normal
- user. While it waits for a new password, check the process
+ one, type <command>passwd</command> as a normal user.
+ While it waits for a new password, check the process
table and look at the user information for
- <command>passwd</command>:</para>
+ &man.passwd.1;:</para>
<para>In terminal A:</para>
@@ -697,9 +706,9 @@ Old Password:</screen>
<screen>trhodes 5232 0.0 0.2 3420 1608 0 R+ 2:10AM 0:00.00 grep passwd
root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
- <para>As stated above, the <command>passwd</command> is run
- by a normal user, but is using the effective
- <acronym>UID</acronym> of <username>root</username>.</para>
+ <para>Although &man.passwd.1; is run as a normal user, it is
+ using the effective <acronym>UID</acronym> of
+ <username>root</username>.</para>
<para>The <literal>setgid</literal> permission performs the
same function as the <literal>setuid</literal> permission;
@@ -709,8 +718,7 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
user who started the process.</para>
<para>To set the <literal>setgid</literal> permission on a
- file, provide <command>chmod</command> with a leading two
- (2):</para>
+ file, provide &man.chmod.1; with a leading two (2):</para>
<screen>&prompt.root; <userinput>chmod 2755 sgidexample.sh</userinput></screen>
@@ -855,8 +863,7 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<row>
<entry><filename
class="directory">/etc/namedb/</filename></entry>
- <entry><command>named</command> configuration files.
- Refer to &man.named.8; for details.</entry>
+ <entry>&man.named.8; configuration files.</entry>
</row>
<row>
@@ -870,8 +877,7 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<row>
<entry><filename
class="directory">/etc/ppp/</filename></entry>
- <entry><command>ppp</command> configuration files as
- described in &man.ppp.8;.</entry>
+ <entry>&man.ppp.8; configuration files.</entry>
</row>
<row>
@@ -967,26 +973,26 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<entry><filename
class="directory">/usr/local/</filename></entry>
<entry>Local executables and libraries. Also used as
- the default destination for the &os; ports
- framework. Within
- <filename class="directory">/usr/local</filename>, the
+ the default destination for the &os; ports framework.
+ Within <filename
+ class="directory">/usr/local</filename>, the
general layout sketched out by &man.hier.7; for
<filename class="directory">/usr</filename> should be
used. Exceptions are the man directory, which is
- directly under
- <filename class="directory">/usr/local</filename>
- rather than under
- <filename class="directory">/usr/local/share</filename>,
- and the ports documentation is in
- <filename class="directory">share/doc/<replaceable>port</replaceable></filename>.</entry>
+ directly under <filename
+ class="directory">/usr/local</filename>
+ rather than under <filename
+ class="directory">/usr/local/share</filename>,
+ and the ports documentation is in <filename
+ class="directory">share/doc/<replaceable>port</replaceable></filename>.</entry>
</row>
<row>
<entry><filename
class="directory">/usr/obj/</filename></entry>
<entry>Architecture-specific target tree produced by
- building the
- <filename class="directory">/usr/src</filename>
+ building the <filename
+ class="directory">/usr/src</filename>
tree.</entry>
</row>
@@ -1051,8 +1057,8 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<entry><filename
class="directory">/var/tmp/</filename></entry>
<entry>Temporary files which are usually preserved
- across a system reboot, unless
- <filename class="directory">/var</filename> is a
+ across a system reboot, unless <filename
+ class="directory">/var</filename> is a
memory-based file system.</entry>
</row>
@@ -1078,47 +1084,45 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<para>Files are stored in directories. A directory may contain no
files, or it may contain many hundreds of files. A directory
- can also contain other directories, allowing you to build up a
- hierarchy of directories within one another in order to organize
+ can also contain other directories, allowing a hierarchy of
+ directories within one another in order to organize
data.</para>
<para>Files and directories are referenced by giving the file or
directory name, followed by a forward slash,
<literal>/</literal>, followed by any other directory names that
- are necessary. For example, if the directory
- <filename class="directory">foo</filename> contains a directory
+ are necessary. For example, if the directory <filename
+ class="directory">foo</filename> contains a directory
<filename class="directory">bar</filename> which contains the
file <filename>readme.txt</filename>, the full name, or
<firstterm>path</firstterm>, to the file is
<filename>foo/bar/readme.txt</filename>. Note that this is
- different from &windows; which uses
- <literal>\</literal> to separate file and directory
- names. &os; does not use drive letters, or other drive names in
- the path. For example, you would not type
- <filename>c:/foo/bar/readme.txt</filename> on &os;.</para>
+ different from &windows; which uses <literal>\</literal> to
+ separate file and directory names. &os; does not use drive
+ letters, or other drive names in the path. For example, one
+ would not type <filename>c:/foo/bar/readme.txt</filename> on
+ &os;.</para>
<para>Directories and files are stored in a file system. Each
file system contains exactly one directory at the very top
level, called the <firstterm>root directory</firstterm> for that
- file system. This root directory can contain other
- directories. One file system is designated the
- <firstterm>root file system</firstterm> or <literal>/</literal>.
- Every other file system is <firstterm>mounted</firstterm> under
- the root file system. No matter how many disks you have on your
- &os; system, every directory appears to be part of the same
- disk.</para>
-
- <para>Suppose you have three file systems, called
- <literal>A</literal>, <literal>B</literal>, and
- <literal>C</literal>. Each file system has one root directory,
- which contains two other directories, called
- <literal>A1</literal>, <literal>A2</literal> (and likewise
- <literal>B1</literal>, <literal>B2</literal> and
+ file system. This root directory can contain other directories.
+ One file system is designated the <firstterm>root file
+ system</firstterm> or <literal>/</literal>. Every other file
+ system is <firstterm>mounted</firstterm> under the root file
+ system. No matter how many disks are on the &os; system, every
+ directory appears to be part of the same disk.</para>
+
+ <para>Consider three file systems, called <literal>A</literal>,
+ <literal>B</literal>, and <literal>C</literal>. Each file
+ system has one root directory, which contains two other
+ directories, called <literal>A1</literal>, <literal>A2</literal>
+ (and likewise <literal>B1</literal>, <literal>B2</literal> and
<literal>C1</literal>, <literal>C2</literal>).</para>
- <para>Call <literal>A</literal> the root file system. If you used
- <command>ls</command> to view the contents of this directory you
- would see two subdirectories, <literal>A1</literal> and
+ <para>Call <literal>A</literal> the root file system. If
+ &man.ls.1; is used to view the contents of this directory,
+ it will show two subdirectories, <literal>A1</literal> and
<literal>A2</literal>. The directory tree looks like
this:</para>
@@ -1137,11 +1141,11 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
</mediaobject>
<para>A file system must be mounted on to a directory in another
- file system. When mounting file system
- <literal>B</literal> on to the directory <literal>A1</literal>,
- the root directory of <literal>B</literal> replaces
- <literal>A1</literal>, and the directories in
- <literal>B</literal> appear accordingly:</para>
+ file system. When mounting file system <literal>B</literal>
+ on to the directory <literal>A1</literal>, the root directory
+ of <literal>B</literal> replaces <literal>A1</literal>, and
+ the directories in <literal>B</literal> appear
+ accordingly:</para>
<mediaobject>
<imageobject>
@@ -1163,10 +1167,9 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<para>Any files that are in the <literal>B1</literal> or
<literal>B2</literal> directories can be reached with the path
- <filename class="directory">/A1/B1</filename> or
- <filename class="directory">/A1/B2</filename> as
- necessary. Any files that were in
- <filename class="directory">/A1</filename> have
+ <filename class="directory">/A1/B1</filename> or <filename
+ class="directory">/A1/B2</filename> as necessary. Any files
+ that were in <filename class="directory">/A1</filename> have
been temporarily hidden. They will reappear if
<literal>B</literal> is <firstterm>unmounted</firstterm> from
<literal>A</literal>.</para>
@@ -1194,9 +1197,8 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
</mediaobject>
<para>and the paths would be
- <filename class="directory">/A2/B1</filename> and
- <filename class="directory">/A2/B2</filename>
- respectively.</para>
+ <filename class="directory">/A2/B1</filename> and <filename
+ class="directory">/A2/B2</filename> respectively.</para>
<para>File systems can be mounted on top of one another.
Continuing the last example, the <literal>C</literal> file
@@ -1252,10 +1254,6 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
</textobject>
</mediaobject>
- <para>Typically you create file systems when installing &os;
- and decide where to mount them, and then never change them
- unless you add a new disk.</para>
-
<para>It is entirely possible to have one large root file system,
and not need to create any others. There are some drawbacks to
this approach, and one advantage.</para>
@@ -1268,9 +1266,9 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<firstterm>mount options</firstterm>. For example, the root
file system can be mounted read-only, making it impossible
for users to inadvertently delete or edit a critical file.
- Separating user-writable file systems, such as
- <filename class="directory">/home</filename>, from other
- file systems allows them to be mounted
+ Separating user-writable file systems, such as <filename
+ class="directory">/home</filename>, from other file
+ systems allows them to be mounted
<firstterm>nosuid</firstterm>. This option prevents the
<firstterm>suid</firstterm>/<firstterm>guid</firstterm> bits
on executables stored on the file system from taking effect,
@@ -1287,9 +1285,9 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
</listitem>
<listitem>
- <para>&os;'s file systems are very robust should you lose
- power. However, a power loss at a critical point could
- still damage the structure of the file system. By splitting
+ <para>&os;'s file systems are robust if power is lost.
+ However, a power loss at a critical point could still
+ damage the structure of the file system. By splitting
data over multiple file systems it is more likely that the
system will still come up, making it easier to restore from
backup as necessary.</para>
@@ -1365,8 +1363,9 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<entry>Normally the same size as the enclosing slice.
This allows utilities that need to work on the entire
slice, such as a bad block scanner, to work on the
- <literal>c</literal> partition. You would not normally
- create a file system on this partition.</entry>
+ <literal>c</literal> partition. A file system would not
+ normally be
+ created on this partition.</entry>
</row>
<row>
@@ -1393,7 +1392,7 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<literal>s</literal>, starting at 1. So
<quote>da0<emphasis>s1</emphasis></quote> is the first slice on
the first SCSI drive. There can only be four physical slices on
- a disk, but you can have logical slices inside physical slices
+ a disk, but there can be logical slices inside physical slices
of the appropriate type. These extended slices are numbered
starting at 5, so <quote>ad0<emphasis>s5</emphasis></quote> is
the first extended slice on the first IDE disk. These devices
@@ -1404,17 +1403,18 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<firstterm>partitions</firstterm>, which are represented as
letters from <literal>a</literal> to <literal>h</literal>. This
letter is appended to the device name, so
- <quote>da0<emphasis>a</emphasis></quote> is the <literal>a</literal> partition on
- the first <literal>da</literal> drive, which is <quote>dangerously
- dedicated</quote>. <quote>ad1s3<emphasis>e</emphasis></quote> is
- the fifth partition in the third slice of the second IDE disk
- drive.</para>
+ <quote>da0<emphasis>a</emphasis></quote> is the
+ <literal>a</literal> partition on the first
+ <literal>da</literal> drive, which is <quote>dangerously
+ dedicated</quote>. <quote>ad1s3<emphasis>e</emphasis></quote>
+ is the fifth partition in the third slice of the second IDE
+ disk drive.</para>
<para>Finally, each disk on the system is identified. A disk name
starts with a code that indicates the type of disk, and then a
number, indicating which disk it is. Unlike slices, disk
- numbering starts at 0. Common codes that you will see are
- listed in <xref linkend="basics-dev-codes"/>.</para>
+ numbering starts at 0. Common codes are listed in <xref
+ linkend="basics-dev-codes"/>.</para>
<para>When referring to a partition, include the disk name,
<literal>s</literal>, the slice number, and then the partition
@@ -1568,12 +1568,11 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<para>The file system is best visualized as a tree,
rooted, as it were, at <filename class="directory">/</filename>.
- <filename class="directory">/dev</filename>,
- <filename class="directory">/usr</filename>, and the
- other directories in the root directory are branches, which may
- have their own branches, such as
- <filename class="directory">/usr/local</filename>, and so
- on.</para>
+ <filename class="directory">/dev</filename>, <filename
+ class="directory">/usr</filename>, and the other directories
+ in the root directory are branches, which may have their own
+ branches, such as <filename
+ class="directory">/usr/local</filename>, and so on.</para>
<indexterm><primary>root file system</primary></indexterm>
<para>There are various reasons to house some of these
@@ -1583,14 +1582,13 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<filename class="directory">spool/</filename>, and various types
of temporary files, and as such, may get filled up. Filling up
the root file system is not a good idea, so splitting <filename
- class="directory">/var</filename> from
- <filename class="directory">/</filename> is often
- favorable.</para>
+ class="directory">/var</filename> from <filename
+ class="directory">/</filename> is often favorable.</para>
<para>Another common reason to contain certain directory trees on
other file systems is if they are to be housed on separate
- physical disks, or are separate virtual disks, such as
- <link linkend="network-nfs">Network File System</link> mounts,
+ physical disks, or are separate virtual disks, such as Network
+ File System mounts, described in <xref linkend="network-nfs"/>,
or CDROM drives.</para>
<sect2 id="disks-fstab">
@@ -1601,7 +1599,7 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<secondary>mounted with fstab</secondary>
</indexterm>
- <para>During the <link linkend="boot">boot process</link>,
+ <para>During the boot process (<xref linkend="boot"/>),
file systems listed in <filename>/etc/fstab</filename> are
automatically mounted except for the entries containing
<option>noauto</option>. This file contains entries in the
@@ -1641,8 +1639,8 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<term><literal>options</literal></term>
<listitem>
- <para>Either <option>rw</option> for read-write
- file systems, or <option>ro</option> for read-only file
+ <para>Either <option>rw</option> for read-write file
+ systems, or <option>ro</option> for read-only file
systems, followed by any other options that may be
needed. A common option is <option>noauto</option> for
file systems not normally mounted during the boot
@@ -1684,7 +1682,7 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
</sect2>
<sect2 id="disks-mount">
- <title>The <command>mount</command> Command</title>
+ <title>Using &man.mount.8;</title>
<indexterm>
<primary>file systems</primary>
@@ -1802,14 +1800,14 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
</sect2>
<sect2 id="disks-umount">
- <title>The <command>umount</command> Command</title>
+ <title>Using &man.umount.8;</title>
<indexterm>
<primary>file systems</primary>
<secondary>unmounting</secondary>
</indexterm>
- <para>To unmount a filesystem use &man.umount.8;. This command
+ <para>To unmount a file system use &man.umount.8;. This command
takes one parameter which can be a mountpoint, device name,
<option>-a</option> or <option>-A</option>.</para>
@@ -1836,27 +1834,27 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
processes that are run by &os;.</para>
<para>Each process is uniquely identified by a number called a
- <firstterm>process ID</firstterm>
- (<firstterm>PID</firstterm>). Similar to files, each process
- has one owner and group, and the owner and group permissions are
- used to determine which files and devices the process can open.
- Most processes also have a parent process that started them.
- For example, the shell is a process, and any command started in
- the shell is a process which has the shell as its parent
- process. The exception is a special process called
- &man.init.8; which is always the first process to start at boot
- time and which always has a PID of 1.</para>
+ <firstterm>process ID</firstterm> (<acronym>PID</acronym>).
+ Similar to files, each process has one owner and group, and
+ the owner and group permissions are used to determine which
+ files and devices the process can open. Most processes also
+ have a parent process that started them. For example, the
+ shell is a process, and any command started in the shell is a
+ process which has the shell as its parent process. The
+ exception is a special process called &man.init.8; which is
+ always the first process to start at boot time and which always
+ has a <acronym>PID</acronym> of 1.</para>
<para>To see the processes on the system, use &man.ps.1; and
&man.top.1;. To display a static list of the currently running
- processes, their PIDs, how much memory they are using, and the
- command they were started with, use <command>ps</command>. To
- display all the running processes and update the display every
- few seconds so that you can interactively see what the computer
- is doing, use <command>top</command>.</para>
+ processes, their <acronym>PID</acronym>s, how much memory they
+ are using, and the command they were started with, use
+ &man.ps.1;. To display all the running processes and update
+ the display every few seconds in order to interactively see
+ what the computer is doing, use &man.top.1;.</para>
- <para>By default, <command>ps</command> only shows the commands
- that are running and owned by the user. For example:</para>
+ <para>By default, &man.ps.1; only shows the commands that are
+ running and owned by the user. For example:</para>
<screen>&prompt.user; <userinput>ps</userinput>
PID TT STAT TIME COMMAND
@@ -1877,15 +1875,16 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
<para>The output from &man.ps.1; is organized into a number of
columns. The <literal>PID</literal> column displays the process
- ID. PIDs are assigned starting at 1, go up to 99999, then wrap
- around back to the beginning. However, a PID is not reassigned
- if it is already in use. The <literal>TT</literal> column shows
- the tty the program is running on and <literal>STAT</literal>
- shows the program's state. <literal>TIME</literal> is the
- amount of time the program has been running on the CPU. This is
- usually not the elapsed time since the program was started, as
- most programs spend a lot of time waiting for things to happen
- before they need to spend time on the CPU. Finally,
+ ID. <acronym>PID</acronym>s are assigned starting at 1, go up
+ to 99999, then wrap around back to the beginning. However, a
+ <acronym>PID</acronym> is not reassigned if it is already in
+ use. The <literal>TT</literal> column shows the tty the program
+ is running on and <literal>STAT</literal> shows the program's
+ state. <literal>TIME</literal> is the amount of time the
+ program has been running on the CPU. This is usually not the
+ elapsed time since the program was started, as most programs
+ spend a lot of time waiting for things to happen before they
+ need to spend time on the CPU. Finally,
<literal>COMMAND</literal> is the command that was used to start
the program.</para>
@@ -1920,25 +1919,25 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
...</screen>
<para>The output is split into two sections. The header (the
- first five lines) shows the PID of the last process to run, the
- system load averages (which are a measure of how busy the system
- is), the system uptime (time since the last reboot) and the
- current time. The other figures in the header relate to how
- many processes are running (47 in this case), how much memory
- and swap space has been used, and how much time the system is
- spending in different CPU states.</para>
+ first five lines) shows the <acronym>PID</acronym> of the last
+ process to run, the system load averages (which are a measure
+ of how busy the system is), the system uptime (time since the
+ last reboot) and the current time. The other figures in the
+ header relate to how many processes are running (47 in this
+ case), how much memory and swap space has been used, and how
+ much time the system is spending in different CPU states.</para>
<para>Below the header is a series of columns containing similar
- information to the output from &man.ps.1;, such as the PID,
- username, amount of CPU time, and the command that started the
- process. By default, &man.top.1; also displays the amount of
- memory space taken by the process. This is split into two
- columns: one for total size and one for resident size. Total
- size is how much memory the application has needed and the
- resident size is how much it is actually using at the moment.
- In this example, <application>mutt</application> has
- required almost 8&nbsp;MB of RAM, but is currently only using
- 5&nbsp;MB.</para>
+ information to the output from &man.ps.1;, such as the
+ <acronym>PID</acronym>, username, amount of CPU time, and the
+ command that started the process. By default, &man.top.1; also
+ displays the amount of memory space taken by the process.
+ This is split into two columns: one for total size and one for
+ resident size. Total size is how much memory the application
+ has needed and the resident size is how much it is actually
+ using at the moment. In this example,
+ <application>mutt</application> has required almost 8&nbsp;MB
+ of RAM, but is currently only using 5&nbsp;MB.</para>
<para>&man.top.1; automatically updates the display every two
seconds. A different interval can be specified with
@@ -1966,14 +1965,13 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<para>There is a convention to name programs that normally run as
daemons with a trailing <quote>d</quote>.
<application>BIND</application> is the Berkeley Internet Name
- Domain, but the actual program that executes is
- <command>named</command>. The <application>Apache</application>
- web server program is <command>httpd</command> and the
- line printer spooling daemon is <command>lpd</command>. This is
- only a naming convention. For example, the main mail daemon for
- the <application>Sendmail</application> application is
- <command>sendmail</command>, and not
- <command>maild</command>.</para>
+ Domain, but the actual program that executes is &man.named.8;.
+ The <application>Apache</application> web server program is
+ <command>httpd</command> and the line printer spooling daemon
+ is &man.lpd.8;. This is only a naming convention. For example,
+ the main mail daemon for the <application>Sendmail</application>
+ application is &man.sendmail.8;, and not
+ <literal>maild</literal>.</para>
<para>One way to communicate with a daemon, or any running
process, is to send a <firstterm>signal</firstterm> using
@@ -2035,15 +2033,15 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<title>Sending a Signal to a Process</title>
<para>This example shows how to send a signal to &man.inetd.8;.
- The <command>inetd</command> configuration file is
- <filename>/etc/inetd.conf</filename>, and
- <command>inetd</command> will re-read this configuration file
- when it is sent a <literal>SIGHUP</literal>.</para>
+ The &man.inetd.8; configuration file is
+ <filename>/etc/inetd.conf</filename>, and &man.inetd.8; will
+ re-read this configuration file when it is sent a
+ <literal>SIGHUP</literal>.</para>
<step>
- <para>Find the PID of the process you want to send the signal
- to using &man.pgrep.1;. In this example, the PID for
- &man.inetd.8; is 198:</para>
+ <para>Find the <acronym>PID</acronym> of the process to send
+ the signal to using &man.pgrep.1;. In this example, the
+ <acronym>PID</acronym> for &man.inetd.8; is 198:</para>
<screen>&prompt.user; <userinput>pgrep -l inetd</userinput>
198 inetd -wW</screen>
@@ -2060,12 +2058,13 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
&prompt.root; <userinput>/bin/kill -s HUP 198</userinput></screen>
<para>Like most &unix; commands, &man.kill.1; will not print
- any output if it is successful. If you send a signal to a
- process that you do not own, you will instead see
+ any output if it is successful. If a signal is sent to a
+ process not owned by that user, the message
<errorname>kill: <replaceable>PID</replaceable>: Operation
- not permitted</errorname>. Mistyping the PID will either
- send the signal to the wrong process, which could have
- negative results, or will send the signal to a PID that is
+ not permitted</errorname> will be displayed. Mistyping
+ the <acronym>PID</acronym> will either send the signal to
+ the wrong process, which could have negative results, or
+ will send the signal to a <acronym>PID</acronym> that is
not currently in use, resulting in the error
<errorname>kill: <replaceable>PID</replaceable>: No such
process</errorname>.</para>
@@ -2092,9 +2091,9 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<important>
<para>Killing a random process on the system can be a bad idea.
- In particular, &man.init.8;, PID 1, is special. Running
- <command>/bin/kill -s KILL 1</command> is a quick, and
- unrecommended, way to shutdown the system.
+ In particular, &man.init.8;, <acronym>PID</acronym> 1, is
+ special. Running <command>/bin/kill -s KILL 1</command> is
+ a quick, and unrecommended, way to shutdown the system.
<emphasis>Always</emphasis> double check the arguments to
&man.kill.1; <emphasis>before</emphasis> pressing
<keycap>Return</keycap>.</para>
@@ -2112,14 +2111,14 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
them. Many shells provide built in functions to help with
everyday tasks such as file management, file globbing, command
line editing, command macros, and environment variables. &os;
- comes with several shells, including <command>sh</command>, the
- Bourne Shell, and <command>tcsh</command>, the improved C-shell.
- Other shells are available from the &os; Ports Collection, such
- as <command>zsh</command> and <command>bash</command>.</para>
+ comes with several shells, including the Bourne shell
+ (&man.sh.1;) and the extended C shell (&man.tcsh.1;). Other
+ shells are available from the &os; Ports Collection, such as
+ <command>zsh</command> and <command>bash</command>.</para>
<para>The shell that is used is really a matter of taste. A C
programmer might feel more comfortable with a C-like shell such
- as <command>tcsh</command>. A Linux user might prefer
+ as &man.tcsh.1;. A &linux; user might prefer
<command>bash</command>. Each shell has unique properties that
may or may not work with a user's preferred working environment,
which is why there is a choice of which shell to use.</para>
@@ -2176,7 +2175,8 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<row>
<entry><envar>DISPLAY</envar></entry>
- <entry>Network name of the <application>Xorg</application>
+ <entry>Network name of the
+ <application>&xorg;</application>
display to connect to, if available.</entry>
</row>
@@ -2231,13 +2231,13 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<indexterm><primary>Bourne shells</primary></indexterm>
<para>How to set an environment variable differs between shells.
- In <command>tcsh</command> and <command>csh</command>, use
+ In &man.tcsh.1; and &man.csh.1;, use
<command>setenv</command> to set environment variables. In
- <command>sh</command> and <command>bash</command>, use
+ &man.sh.1; and <command>bash</command>, use
<command>export</command> to set the current environment
variables. This example sets the default <envar>EDITOR</envar>
to <filename>/usr/local/bin/emacs</filename> for the
- <command>tcsh</command> shell:</para>
+ &man.tcsh.1; shell:</para>
<screen>&prompt.user; <userinput>setenv EDITOR /usr/local/bin/emacs</userinput></screen>
@@ -2254,13 +2254,12 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<para>Shells treat special characters, known as meta-characters,
as special representations of data. The most common
- meta-character is <literal>*</literal>, which
- represents any number of characters in a filename.
- Meta-characters can be used to perform filename globbing. For
- example, <command>echo *</command> is equivalent to
- <command>ls</command> because the shell takes all the files that
- match <literal>*</literal> and <command>echo</command> lists
- them on the command line.</para>
+ meta-character is <literal>*</literal>, which represents any
+ number of characters in a filename. Meta-characters can be
+ used to perform filename globbing. For example, <command>echo
+ *</command> is equivalent to &man.ls.1; because the shell
+ takes all the files that match <literal>*</literal> and
+ &man.echo.1; lists them on the command line.</para>
<para>To prevent the shell from interpreting a special character,
escape it from the shell by starting it with a backslash
@@ -2276,9 +2275,8 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
to use <command>chsh</command>. Running this command will
open the editor that is configured in the
<envar>EDITOR</envar> environment variable, which by default
- is set to <command>vi</command>. Change
- the <quote>Shell:</quote> line to the full path of the
- new shell.</para>
+ is set to &man.vi.1;. Change the <quote>Shell:</quote> line
+ to the full path of the new shell.</para>
<para>Alternately, use <command>chsh -s</command> which will set
the specified shell without opening an editor. For example,
@@ -2289,15 +2287,15 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<note>
<para>The new shell <emphasis>must</emphasis> be present in
<filename>/etc/shells</filename>. If the shell was
- installed from the &os; <link linkend="ports">Ports
- Collection</link>, it should be automatically added to
- this file. If it is missing, add it using this
+ installed from the &os; Ports Collection as described in
+ <xref linkend="ports"/>, it should be automatically added
+ to this file. If it is missing, add it using this
command, replacing the path with the path of the
shell:</para>
<screen>&prompt.root; <userinput>echo <replaceable>/usr/local/bin/bash</replaceable> &gt;&gt; /etc/shells</userinput></screen>
- <para>Then rerun <command>chsh</command>.</para>
+ <para>Then rerun &man.chsh.1;.</para>
</note>
</sect2>
</sect1>
@@ -2318,12 +2316,12 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
</indexterm>
<indexterm>
<primary>editors</primary>
- <secondary><command>ee</command></secondary>
+ <secondary>&man.ee.1;</secondary>
</indexterm>
- <para>A simple editor to learn is <application>ee</application>,
- which stands for easy editor. To start this editor, type
- <command>ee <replaceable>filename</replaceable></command> where
+ <para>A simple editor to learn is &man.ee.1;, which stands for
+ easy editor. To start this editor, type <command>ee
+ <replaceable>filename</replaceable></command> where
<replaceable>filename</replaceable> is the name of the file to
be edited. Once inside the editor, all of the commands for
manipulating the editor's functions are listed at the top of the
@@ -2331,18 +2329,17 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<keycap>Ctrl</keycap>, so <literal>^e</literal> expands to
<keycombo
action="simul"><keycap>Ctrl</keycap><keycap>e</keycap></keycombo>.
- To leave <application>ee</application>, press
- <keycap>Esc</keycap>, then choose the <quote>leave
- editor</quote> option from the main menu. The editor will
- prompt you to save any changes if the file has been
+ To leave &man.ee.1;, press <keycap>Esc</keycap>, then choose
+ the <quote>leave editor</quote> option from the main menu.
+ The editor will prompt to save any changes if the file has been
modified.</para>
<indexterm>
- <primary><command>vi</command></primary>
+ <primary>&man.vi.1;</primary>
</indexterm>
<indexterm>
<primary>editors</primary>
- <secondary><command>vi</command></secondary>
+ <secondary>&man.vi.1;</secondary>
</indexterm>
<indexterm>
<primary><command>emacs</command></primary>
@@ -2352,10 +2349,9 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<secondary><command>emacs</command></secondary>
</indexterm>
- <para>&os; also comes with more powerful text editors such as
- <application>vi</application> as part of the base system.
- Other editors, like <filename
- role="package">editors/emacs</filename> and
+ <para>&os; also comes with more powerful text editors, such as
+ &man.vi.1;, as part of the base system. Other editors, like
+ <filename role="package">editors/emacs</filename> and
<filename role="package">editors/vim</filename>, are part of the
&os; Ports Collection. These editors offer more functionality
at the expense of being a more complicated to learn. Learning a
@@ -2366,8 +2362,7 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<para>Many applications which modify files or require typed input
will automatically open a text editor. To alter the default
editor used, set the <envar>EDITOR</envar> environment
- variable as described in the <link
- linkend="shells">shells</link> section.</para>
+ variable as described in <xref linkend="shells"/>.</para>
</sect1>
<sect1 id="basics-devices">
@@ -2393,8 +2388,23 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<sect1 id="binary-formats">
<title>Binary Formats</title>
- <para>To understand why &os; uses the &man.elf.5; format,the three
- currently <quote>dominant</quote> executable formats for &unix;
+ <para>Typically when a command is passed to the shell, the shell
+ will arrange for an executable file to be loaded into memory and
+ a new process is created. Executable files can either be a binary
+ file (usually created by the linker as part of compiling a program)
+ or a shell script (text file to be interpreted by a binary file,
+ like &man.sh.1; or &man.perl.1;). The &man.file.1; command can
+ usually determine what is inside a file.</para>
+
+ <para>Binary files need to have a well defined format for the system
+ to be able to use them properly. Part of the file will be the
+ executable machine code (the instructions that tell the CPU what
+ to do), part of it will be data space with pre-defined values,
+ part will be data space with no pre-defined values, etc. Through
+ time, different binary file formats have evolved.</para>
+
+ <para>To understand why &os; uses the &man.elf.5; format, the three
+ currently <quote>dominant</quote>, executable formats for &unix;
must be described:</para>
<itemizedlist>
@@ -2441,8 +2451,8 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
the &man.a.out.5; format, a technology tried and proven through
many generations of BSD releases, until the beginning of the 3.X
branch. Though it was possible to build and run native
- <acronym>ELF</acronym> binaries and kernels on a &os;
- system for some time before that, &os; initially resisted the
+ <acronym>ELF</acronym> binaries and kernels on a &os; system
+ for some time before that, &os; initially resisted the
<quote>push</quote> to switch to <acronym>ELF</acronym> as the
default format. Why? When Linux made its painful transition to
<acronym>ELF</acronym>, it was due to their inflexible
@@ -2502,9 +2512,8 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
programs rewrote them and added simpler support for building
cross compilers and plugging in different formats. Those who
wanted to build cross compilers targeting &os; were out of luck
- since the older sources that &os; had for
- <application>as</application> and <application>ld</application>
- were not up to the task. The new GNU tools chain
+ since the older sources that &os; had for &man.as.1; and
+ &man.ld.1; were not up to the task. The new GNU tools chain
(<application>binutils</application>) supports cross
compiling, <acronym>ELF</acronym>, shared libraries, and C++
extensions. In addition, many vendors release
@@ -2539,8 +2548,8 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<screen>&prompt.user; <userinput>man <replaceable>command</replaceable></userinput></screen>
<para>where <replaceable>command</replaceable> is the name of
- the command you wish to learn about. For example, to learn
- more about <command>ls</command>, type:</para>
+ the command to learn about. For example, to learn more about
+ &man.ls.1;, type:</para>
<screen>&prompt.user; <userinput>man ls</userinput></screen>
@@ -2587,21 +2596,19 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<para>In some cases, the same topic may appear in more than one
section of the online manual. For example, there is a
- <command>chmod</command> user command and a
- <function>chmod()</function> system call. To tell
- <command>man</command> which section to display, specify the
- section number:</para>
+ &man.chmod.1; user command and a
+ <function>chmod()</function> system call. To tell &man.man.1;
+ which section to display, specify the section number:</para>
<screen>&prompt.user; <userinput>man 1 chmod</userinput></screen>
<para>This will display the manual page for the user command
- <command>chmod</command>. References to a particular section
- of the online manual are traditionally placed in parenthesis
- in written documentation, so &man.chmod.1; refers to the
- <command>chmod</command> user command and &man.chmod.2; refers
- to the system call.</para>
+ &man.chmod.1;. References to a particular section of the
+ online manual are traditionally placed in parenthesis in
+ written documentation, so &man.chmod.1; refers to the user
+ command and &man.chmod.2; refers to the system call.</para>
- <para>If you do not know the command name, use <command>man
+ <para>If the command name is unknown, use <command>man
-k</command> to search for keywords in the command
descriptions:</para>
@@ -2611,8 +2618,8 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
keyword <quote>mail</quote> in their descriptions. This is
equivalent to using &man.apropos.1;.</para>
- <para>To determine what the commands in
- <filename class="directory">/usr/bin</filename> do,
+ <para>To determine what the commands in <filename
+ class="directory">/usr/bin</filename> do,
type:</para>
<screen>&prompt.user; <userinput>cd /usr/bin</userinput>
@@ -2636,7 +2643,7 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
by the Free Software Foundation (FSF). In addition to manual
pages, these programs may include hypertext documents called
<literal>info</literal> files. These can be viewed using
- <command>info</command> or, if <filename
+ &man.info.1; or, if <filename
role="package">editors/emacs</filename> is installed, the
info mode of <application>emacs</application>.</para>