- Revise some comma usage
- Revise wording of some sentences - Use <acronym> and <filename> tags - Follow FDP on continuous repetition of &man.command.#; - Write out numbers under 10 - Show an example of complete output of "ls -l" command - Mention after successfully logging in, you will see the MOTD, and the command prompt - Remove misleading comment about how chmod ### can only "set and assign" permissions, but not remove them. - "CPU time evenly to each user" -> "CPU time fairly to each user" - "permissions stored as two octets" -> "permissions stored as three octets" Sponsored by: FreeBSD Mall, Inc.
This commit is contained in:
parent
0541916663
commit
277441b9e8
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=18284
1 changed files with 46 additions and 29 deletions
|
@ -74,17 +74,17 @@
|
|||
<indexterm><primary>UNIX</primary></indexterm>
|
||||
|
||||
<para>FreeBSD, being a direct descendant of BSD &unix;, is based on
|
||||
several key &unix; concepts. The first, and
|
||||
most pronounced, is that FreeBSD is a multi-user operating system.
|
||||
several key &unix; concepts. The first and
|
||||
most pronounced is that FreeBSD is a multi-user operating system.
|
||||
The system can handle several users all working simultaneously on
|
||||
completely unrelated tasks. The system is responsible for properly
|
||||
sharing and managing requests for hardware devices, peripherals,
|
||||
memory, and CPU time evenly to each user.</para>
|
||||
memory, and CPU time fairly to each user.</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 permissions are
|
||||
stored as two octets broken into three pieces, one for the owner of
|
||||
stored as three octets broken into three pieces, one for the owner of
|
||||
the file, one for the group that the file belongs to, and one for
|
||||
everyone else. This numerical representation works like
|
||||
this:</para>
|
||||
|
@ -162,8 +162,18 @@
|
|||
<para>You can use the <option>-l</option> command line
|
||||
argument to &man.ls.1; to view a long directory listing that
|
||||
includes a column with information about a file's permissions
|
||||
for the owner, group, and everyone else. Here is how the first
|
||||
column of <command>ls -l</command> is broken up:</para>
|
||||
for the owner, group, and everyone else. For example, a
|
||||
<command>ls -l</command> in an arbitrary directory may show:</para>
|
||||
|
||||
<screen>&prompt.user; ls -l
|
||||
total 530
|
||||
-rw-r--r-- 1 root wheel 512 Sep 5 12:31 myfile
|
||||
-rw-r--r-- 1 root wheel 512 Sep 5 12:31 otherfile
|
||||
-rw-r--r-- 1 root wheel 7680 Sep 5 12:31 email.txt
|
||||
...</screen>
|
||||
|
||||
<para>Here is how the first column of <command>ls -l</command> is
|
||||
broken up:</para>
|
||||
|
||||
<screen>-rw-r--r--</screen>
|
||||
|
||||
|
@ -193,8 +203,8 @@
|
|||
<para>Directories are also treated as files. They have read, 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 can be moved into, i.e. it is
|
||||
possible to <quote>cd</quote> into it. This also means that
|
||||
marked executable, it means it can be traversed into, that is, it is
|
||||
possible to <quote>cd</quote> (change directory) into it. This also means that
|
||||
within the directory it is possible to access files whose names are
|
||||
known (subject, of course, to the permissions on the files
|
||||
themselves).</para>
|
||||
|
@ -331,9 +341,11 @@
|
|||
|
||||
<screen>&prompt.user; <userinput>chmod go-w,a+x <replaceable>FILE</replaceable></userinput></screen>
|
||||
|
||||
<!--
|
||||
<para>Most users will not notice this, but it should be pointed out
|
||||
that using the octal method will only set or assign permissions to
|
||||
a file; it does not add or delete them.</para>
|
||||
-->
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
@ -1244,7 +1256,7 @@
|
|||
|
||||
<listitem>
|
||||
<para>Mount all the file systems listed in
|
||||
<filename>/etc/fstab</filename>. Exceptions are those
|
||||
<filename>/etc/fstab</filename>. Except those
|
||||
marked as <quote>noauto</quote>, excluded by the
|
||||
<option>-t</option> flag, or those that are already
|
||||
mounted.</para>
|
||||
|
@ -1255,7 +1267,7 @@
|
|||
<term><option>-d</option></term>
|
||||
|
||||
<listitem>
|
||||
<para>Do everything except for the actual system call.
|
||||
<para>Do everything except for the actual mount system call.
|
||||
This option is useful in conjunction with the
|
||||
<option>-v</option> flag to determine what
|
||||
&man.mount.8; is actually trying to do.</para>
|
||||
|
@ -1400,19 +1412,19 @@
|
|||
then the shell is a process, and any commands you run are also
|
||||
processes. Each process you run in this way will have your shell as its
|
||||
parent process. The exception to this is a special process called
|
||||
<command>init</command>. <command>init</command> is always the first
|
||||
&man.init.8;. <command>init</command> is always the first
|
||||
process, so its PID is always 1. <command>init</command> is started
|
||||
automatically by the kernel when FreeBSD starts.</para>
|
||||
|
||||
<para>Two commands are particularly useful to see the processes on the
|
||||
system, &man.ps.1; and &man.top.1;. The &man.ps.1; command is used to
|
||||
system, &man.ps.1; and &man.top.1;. The <command>ps</command> command is used to
|
||||
show a static list of the currently running processes, and can show
|
||||
their PID, how much memory they are using, the command line they were
|
||||
started with, and so on. The &man.top.1; command displays all the
|
||||
started with, and so on. The <command>top</command> command displays all the
|
||||
running processes, and updates the display every few seconds, so that
|
||||
you can interactively see what your computer is doing.</para>
|
||||
|
||||
<para>By default, &man.ps.1; only shows you the commands that are running
|
||||
<para>By default, <command>ps</command> only shows you the commands that are running
|
||||
and are owned by you. For example:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>ps</userinput>
|
||||
|
@ -1438,12 +1450,12 @@
|
|||
organized into a number of columns. <literal>PID</literal> is the
|
||||
process ID discussed earlier. PIDs are assigned starting from 1, go up
|
||||
to 99999, and wrap around back to the beginning when you run out.
|
||||
<literal>TT</literal> shows the tty the program is running on, and can
|
||||
The <literal>TT</literal> column shows the tty the program is running on, and can
|
||||
safely be ignored for the moment. <literal>STAT</literal> shows the
|
||||
program's state, and again, can be safely ignored.
|
||||
<literal>TIME</literal> is the amount of time the program has been
|
||||
running on the CPU—this is not necessarily the elapsed time since
|
||||
you started the program, as some programs spend a lot of time waiting
|
||||
running on the CPU—this is usually not the elapsed time since
|
||||
you started the program, 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 line that was used to
|
||||
run the program.</para>
|
||||
|
@ -1600,8 +1612,8 @@ 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
|
||||
&man.inetd.8; configuration file is
|
||||
<filename>/etc/inetd.conf</filename>, and &man.inetd.8; will re-read
|
||||
<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
|
||||
<literal>SIGHUP</literal>.</para>
|
||||
|
||||
|
@ -1798,7 +1810,7 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
|
|||
</informaltable>
|
||||
|
||||
<indexterm><primary>Bourne shells</primary></indexterm>
|
||||
<para>To set an environment variable differs somewhat from
|
||||
<para>Setting an environment variable differs somewhat from
|
||||
shell to shell. For example, in the C-Style shells such as
|
||||
<command>tcsh</command> and <command>csh</command>, you would use
|
||||
<command>setenv</command> to set environment variables.
|
||||
|
@ -1903,7 +1915,7 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
|
|||
<command>ee /etc/rc.conf</command>. Once inside of
|
||||
<command>ee</command>, all of the
|
||||
commands for manipulating the editor's functions are listed at the
|
||||
top of the display. The caret <literal>^</literal> character means
|
||||
top of the display. The caret <literal>^</literal> character represents
|
||||
the <keycap>Ctrl</keycap> key on the keyboard, so <literal>^e</literal> expands to the key combination
|
||||
<keycombo action="simul"><keycap>Ctrl</keycap><keycap>e</keycap></keycombo>. To leave
|
||||
<application>ee</application>, hit the <keycap>Esc</keycap> key, then choose leave
|
||||
|
@ -2092,6 +2104,11 @@ Password:</screen>
|
|||
<para>If you have typed your password correctly, you should by now be
|
||||
logged into FreeBSD and ready to try out all the available
|
||||
commands.</para>
|
||||
|
||||
<para>You should see the <acronym>MOTD</acronym> or message of
|
||||
the day followed by a command prompt (a <literal>#</literal>,
|
||||
<literal>$</literal>, or <literal>$</literal> character). This
|
||||
indicates you have successfully logged into FreeBSD.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="consoles-virtual">
|
||||
|
@ -2137,7 +2154,7 @@ Password:</screen>
|
|||
<sect2 id="consoles-ttys">
|
||||
<title>The <filename>/etc/ttys</filename> File</title>
|
||||
|
||||
<para>The default configuration of FreeBSD will start up with 8
|
||||
<para>The default configuration of FreeBSD will start up with eight
|
||||
virtual consoles. This is not a hardwired setting though, and
|
||||
you can easily customize your installation to boot with more
|
||||
or fewer virtual consoles. The number and settings of the
|
||||
|
@ -2148,8 +2165,8 @@ Password:</screen>
|
|||
the virtual consoles of FreeBSD. Each uncommented line in this file
|
||||
(lines that do not start with a <literal>#</literal> character) contains
|
||||
settings for a single terminal or virtual console. The default
|
||||
version of this file that ships with FreeBSD configures 9 virtual
|
||||
consoles, and enables 8 of them. They are the lines that start with
|
||||
version of this file that ships with FreeBSD configures nine virtual
|
||||
consoles, and enables eight of them. They are the lines that start with
|
||||
<literal>ttyv</literal>:</para>
|
||||
|
||||
<programlisting># name getty type status comments
|
||||
|
@ -2195,7 +2212,7 @@ console none unknown off secure</programlisting>
|
|||
<username>root</username> password.</para>
|
||||
|
||||
<para><emphasis>Be careful when changing this to
|
||||
<literal>insecure</literal> though.</emphasis> If you ever forget
|
||||
<literal>insecure</literal></emphasis> If you ever forget
|
||||
the <username>root</username> password, booting into single user
|
||||
mode is a bit involved. It is still possible, but it might be a bit
|
||||
hard for someone who is not very comfortable with the FreeBSD
|
||||
|
@ -2208,7 +2225,7 @@ console none unknown off secure</programlisting>
|
|||
<title>Binary Formats</title>
|
||||
|
||||
<para>To understand why FreeBSD uses the <acronym>ELF</acronym>
|
||||
format, you must first know a little about the 3 currently
|
||||
format, you must first know a little about the three currently
|
||||
<quote>dominant</quote> executable formats for &unix;:</para>
|
||||
|
||||
<itemizedlist>
|
||||
|
@ -2286,7 +2303,7 @@ console none unknown off secure</programlisting>
|
|||
force software to do some sleazy tricks, then he would be able
|
||||
to shave a few gates off the design and allow his CPU core to
|
||||
run faster. While it was made to work with this new kind of
|
||||
hardware (known these days as RISC), <filename>a.out</filename>
|
||||
hardware (known these days as <acronym>RISC</acronym>), <filename>a.out</filename>
|
||||
was ill-suited for this hardware, so many formats were developed
|
||||
to get to a better performance from this hardware than the
|
||||
limited, simple <filename>a.out</filename> format could
|
||||
|
@ -2322,7 +2339,7 @@ console none unknown off secure</programlisting>
|
|||
added shared libraries and fixed some bugs. The GNU folks that
|
||||
originally write these programs rewrote them and added simpler
|
||||
support for building cross compilers, plugging in different
|
||||
formats at will, etc. Since many people wanted to build cross
|
||||
formats at will, and so on. Since many people wanted to build cross
|
||||
compilers targeting FreeBSD, they were out of luck since the
|
||||
older sources that FreeBSD had for <application>as</application> and <application>ld</application> were not up to the
|
||||
task. The new GNU tools chain (<application>binutils</application>) does support cross
|
||||
|
@ -2340,7 +2357,7 @@ console none unknown off secure</programlisting>
|
|||
details that are different between the two in how they map
|
||||
pages, handle init code, etc. None of these are very important,
|
||||
but they are differences. In time support for
|
||||
<filename>a.out</filename> will be moved out of the GENERIC
|
||||
<filename>a.out</filename> will be moved out of the <filename>GENERIC</filename>
|
||||
kernel, and eventually removed from the kernel once the need to
|
||||
run legacy <filename>a.out</filename> programs is past.</para>
|
||||
</sect1>
|
||||
|
|
Loading…
Reference in a new issue