What is Linux?
Linux is a free open-source multi-user multi-threaded operating system with
excellent reliability and security. It is based on Unix and in most respects
is considered to work like Unix. The core part of the operating system was
created by Linus Torvalds, a Finnish computer science student, in the mid-1990s.
He was looking for a way to learn Unix system administration and other versions
of Unix work-alikes, such as Minnix, did not suit his requirements.
What is Open Source Software?
Linux and the Unix-like utilities used with it are generally distributed under
a licence created by Richard Stallman and the the Free Software Foundation
(http://www.fsf.org) called the GNU General
Public License or GPL. This license has several interesting features.
You should read the actual
GNU General Public License
- The copyright for software distributed under the GPL is retained by the
author of the software.
- GPL software may be sold but a free version must also be available.
- The source code for GPL software must also be available.
- If another person makes improvements to GPL software, they must
distribute it under the same rules outlined by the GPL.
How is the Linux filesystem arranged?
Since Linux is based on Unix, it is not surprising that its filesystem is also
based on Unix. The following directories are commonly found on Linux systems
and some commentary is provided about their typical content:
Programs available to all users (see also |
Linux Kernel and other files needed to start the operating system.
Virtual directory created at boot time to identify existing or
potential devices for a system. All hardware in Unix/Linux is
treated as a file. This simplifies programming.
Configuration files. These are mostly text files which may be
edited to change the behavior of the system and its programs.
Home directories for ordinary users. The root user's files are
Shared libraries used by several programs.
Mount points for external filesystems.
commonly used for CD-ROM filesystems.
Place to install some local programs. Used by StarOffice.
Virtual directory created at boot time to store information about
running processes and installed hardware. It contains many files
which can be read (|
/proc/cpuinfo for example).
Root user's home directory.
Programs primarily used by the root user. Some items, like
/sbin/ifconfig, have limited use by ordinary users.
Temporary directory. Any user may write files to it. However,
only the user who creates a file may alter or delete it, except
root of course who can do just about anything.
Programs which may be specific to a given distribution or local to a
specific machine. Subdirectories include
Active and dynamic directory containing logfiles, process ID files,
incoming email, web pages (by default), MySQL databases, etc.
Non-standard directory on many Linux systems to store web pages.
What is the boot sequence for Linux?
When a machine is first turned on, it performs a power-on self-test
(POST) which checks for memory and key devices. The hardware
then looks at the first boot device (CD-ROM, floppy, first hard drive)
for bootable software.
If this is the first hard drive, it looks in a special sector called the
Master Boot Record (MBR) for information on the way the drive is
partitioned and a boot loader which tells it where bootable software may
On most Linux systems, the common boot loaders are
Linux Loader) and
GRUB (the Grand Unified Boot Loader). It
is also possible to use the Windows boot loader or a 3rd party application
SystemCommander. The boot loader allows the user to
select which operating system will be used during the boot sequence. A
default value is usually selected after a short delay if no choice is made
by the user.
After the Linux kernel is loaded (
/boot/vmlinuz) the system
/etc/inittab file for instructions on the run
level to be used and other key settings. There are seven run levels on
Linux systems and their definition varies from distribution to distribution.
On a Red Hat system, the following values are used:
|0||Halt. Shuts down system and turns off power.|
|1||Single User. Starts system and runs as root user.|
|2||Multi-user without Network File System.|
|3||Full Multi-user. Use this most of the time.|
|5||Full Multi-user with X-window login.|
|6||Reboot. Shut down system and restart.|
After the run level is identified, symbolic links to files in
/etc/rc.d/rcX.d (where X is
the run level number) are executed in alphabetical order to start or stop
(kill) server programs. The
ntsysv program is helpful to
specify which programs are turned on at boot.
The final file to be processed is
/etc/rc.d/rc.local which may
contain statements to be executed before a login screen is available at the
console or remote connections are permitted.
What are some common Linux commands?
Linux commands are generally similar to or identical to Unix commands.
Here are some useful ones which you may want to look at.
List the files or directories. (|
ls -la /etc).
Print working directory.
Change directory. (
Display current effective username.
who am i
Display information about effective username, server, connection.
Display list of users logged in to system and current activity.
Display content of filename to standard output (usually the
Display content of filename to standard output one screen at
a time. (|
less command is better).
Display content of filename to standard output with full
scrolling capabilities along with
vi-style search and
cp oldname newname
Copy a file from oldname to newname. Original file
mv oldname newname
Move a file from oldname to newname. Original file
is removed after copy. May be used to rename a file.
Remove (delete) a file.
grep word filename
Display lines which contain word from filename.