|
-- |
|
Exploring Linux Logging
In The first thing that you have to do to use the Linux system is
to log in. The purpose of logging is twofold: to let the LINUX system verify
your right to use the system and to let the LINUX system set up your
environment. If you have set up linux on your personal computer then you
propably have already created an account for yourself during the installation
process. If the you don't have "control" of the system then you
would probably ask the system administrator to create an account for you ( or
HACK an account !!). Once you
have an account you can try logging in. The linux system will display
something like this : Login : Now you can
type your account name and hit return. After a brief pause it will ask for
the password. Type your password and hit return. If everything goes ok linux
will a prompt to indicate that it is ready to accept your commands. Some
simple commands Lets try
typing some simple commands. Type the Linux system command date The system
should display the date and time. Next type the command who The system
should display a list of the people who are currently using the system along
with the time the first logged in and the identification name of the terminal
they are using. Type the command echo hello The system
should display the message "hello". In this command the word
"echo" is the name of the command and the word "hello" is
an argument to the command. The echo command simple repeats its arguments. (
It's hard to imagine how important echo is. Later we will discover the power
of echo ). In the linux system, commands and their arguments are separated by
spaces or tabs. Linux is also case sensitive. If you enter the command Echo hello your will
get an error meessage because there is no command named "Echo". The File
system The
directory tree The full directory tree is intended to be breakable into smaller
parts, each on its own disk or partition, to accomodate to disk size limits
and to ease backup and other system administration. The major parts are the
root, /usr , /var , and /home filesystems. Each part has a different purpose.
The directory tree has been designed so that it works well in a network of
Linux machines which may share some parts of the filesystems over a read-only
device (e.g., a CD-ROM), or over the network with NFS. The roles of the different parts of the directory tree are
described below.
The Linux filesystem structure groups files according to
purpose, i.e., all commands are in one place, all data files in another,
documentation in a third, and so on. An alternative would be to group files
files according to the program they belong to, i.e., all Emacs files would be
in one directory, all TeX in another, and so on. The problem with the latter
approach is that it makes it difficult to share files (the program directory
often contains both static and shareable and changing and non-shareable
files), and sometimes to even find the files (e.g., manual pages in a huge
number of places, and making the manual page programs find all of them is a
maintenance nightmare). The root
filesystem The root filesystem should generally be small, since it contains
very critical files and a small, infrequently modified filesystem has a
better chance of not getting corrupted. A corrupted root filesystem will
generally mean that the system becomes unbootable except with special
measures (e.g., from a floppy), so you don't want to risk it. The root directory generally doesn't contain any files, except
perhaps the standard boot image for the system, usually called /vmlinuz . All
other files are in subdirectories in the root filesystems: /bin Commands needed during bootup that might be used by normal users
(probably after bootup). /sbin Like /bin , but the commands are not intended for normal users,
although they may use them if necessary and allowed. /etc Configuration files specific to the machine. /root The home directory for user root. /lib Shared libraries needed by the programs on the root filesystem. /lib/modules Loadable kernel modules, especially those that are needed to
boot the system when recovering from disasters (e.g., network and filesystem
drivers). /dev Device files. /tmp Temporary files. Programs running after bootup should use
/var/tmp , not /tmp , since the former is probably on a disk with more space.
/boot Files used by the bootstrap loader, e.g., LILO. Kernel images
are often kept here instead of in the root directory. If there are many
kernel images, the directory can easily grow rather big, and it might be
better to keep it in a separate filesystem. Another reason would be to make
sure the kernel images are within the first 1024 cylinders of an IDE disk. /mnt Mount point for temporary mounts by the system administrator.
Programs aren't supposed to mount on /mnt automatically. /mnt might be
divided into subdirectories (e.g., /mnt/dosa might be the floppy drive using
an MS-DOS filesystem, and /mnt/exta might be the same with an ext2
filesystem). /proc , /usr , /var , /home Mount points for the other filesystems. The /usr
filesystem The /usr filesystem is often large, since all programs are
installed there. All files in /usr usually come from a Linux distribution;
locally installed programs and other stuff goes below /usr/local . This makes
it possible to update the system from a new version of the distribution, or
even a completely new distribution, without having to install all programs
again. Some of the subdirectories of /usr are listed below (some of the less
important directories have been dropped; see the FSSTND for more
information). /usr/X11R6 The X Window System, all files. To simplify the development and
installation of X, the X files have not been integrated into the rest of the
system. There is a directory tree below /usr/X11R6 similar to that below /usr
itself. /usr/X386 Similar to /usr/X11R6 , but for X11 Release 5. /usr/bin Almost all user commands. Some commands are in /bin or in
/usr/local/bin . /usr/sbin System administration commands that are not needed on the root
filesystem, e.g., most server programs. /usr/man , /usr/info , /usr/doc Manual pages, GNU Info documents, and miscellaneous other
documentation files, respectively. /usr/include Header files for the C programming language. This should
actually be below /usr/lib for consistency, but the tradition is
overwhelmingly in support for this name. /usr/lib Unchanging data files for programs and subsystems, including
some site-wide configuration files. The name lib comes from library;
originally libraries of programming subroutines were stored in /usr/lib . /usr/local The place for locally installed software and other files. Email : aelqursh@islamway.net |