You are on page 1of 13

INTRODUCTION TO LINUX

UNIX is an operating system which was first developed in the 1960s, and has been under
constant development ever since. By operating system, we mean the suite of programs which
make the computer work. It is a stable, multi-user, multi-tasking system for servers, desktops and
laptops.
UNIX systems also have a graphical user interface (GUI) similar to Microsoft Windows
which provides an easy to use environment. However, knowledge of UNIX is required for
operations which aren't covered by a graphical program, or for when there is no windows
interface available, for example, in a telnet session.
There are many different versions of UNIX, although they share common similarities.
The most popular varieties of UNIX are Sun Solaris, GNU/Linux, and MacOS X. Linux is a full
UNIX clone, fit for use on workstations as well as on middle-range and high-end servers. The
UNIX operating system is made up of three parts; the kernel, the shell and the programs.

The kernel
The kernel of UNIX is the hub of the operating system: it allocates time and memory to
programs and handles the filestore and communications in response to system calls.
The shell
The shell acts as an interface between the user and the kernel. When a user logs in, the login
program checks the username and password, and then starts another program called the shell.
The shell is a command line interpreter (CLI). It interprets the commands the user types in and
arranges for them to be carried out. The commands are themselves programs: when they
terminate, the shell gives the user another prompt.
LINUX
Linux is a free and open source operating system that enables the applications to access the
devices on the computer to perform desired functions. The operating system (OS) relays
instructions from an application to, for instance, the computer's processor. The processor

performs the instructed task, then sends the results back to the application via the operating
system. Linux includes virtual memory, shared libraries, demand loading, memory
management, TCP/IP networking and other features that are available with current full featured
commercial operating systems.
A feature of Linux operating system that distinguishes it from other operating systems is
that it is one of the few operating systems whose source code is also available as free software
under the GNU General Public License (GPL). . The GNU GPL is intended to safeguard and
guarantee the freedom of any user of free software to share, modify and also share the modified
software. This is in contrast to the licenses given for proprietary software that prohibits its users
to share or modify software.
A full fledged Unix system however requires a set of applications and support software
that make the system user friendly. Hundreds of programmers around the world have
contributed to bring the Linux system to its current state of robustness. The Linux kernel along
with a combination of these contributed utilities and applications forms a complete operating
system. The Linux operating system in any form or distribution is neither public domain nor is
it shareware. Linux is called free software because of the fact that the source code is available to
any user freely.
The Linux operating system is distributed in various user friendly installation packages.
Most of these distributions are available on CDROM and are easy to install. Most of the
distributions are commercially available while others are available only through the Internet.
Some of the distributions available on CDROM are Slackware, Redhat Linux, Caldera
OpenLinux, Debian Linux, LinuxPro, Trans-Ameritech Linuxware and the S.u.S.E.

Linux High Level Architecture


Linux is basically a kernel around which applications are added and form an operating
system. In Linux operating system all the applications directly deal with kernel and further
kernel communicate with the hardware resources and device drivers. Whereas in Windows
operating system the architecture is very complex and applications takes more processing time
to get access to hardware resources. As an operating system, it is the piece of code that is

loaded into the memory of computer on boot up and then manages the resources available,
providing for the needs of users and applications.

Shell is the command interpreter which reads the program we type at terminal, line by
line and perform the required operations. The shell is the part of Linux O.S that acts as an
intermediary between user and the O.S. It develops a shell around the system that converts our
instructions into commands, which helps the system to understand and act on it. Linux system
provides every user its own copy of shell program which makes him work freely without any
interference of other users.
The other component of the Linux O.S is the kernel which makes a direct interface with
the hardware components. The kernel make creation and deletion of processes, schedule the
memory management and I/O management of the processor. It provides a mechanism for
synchronization of processes so that processes synchronize their actions. It provides mechanism
for inter process communication.

Features of Linux
1. Linux is free:
The license commonly used is the GNU Public License (GPL). The license says that
anybody who may want to do so, has the right to change Linux and eventually to

redistribute a changed version, on the one condition that the code is still available after
redistribution. In practice, you are free to grab a kernel image, for instance to add
support for teletransportation machines or time travel and sell your new code, as long as
your customers can still have a copy of that code.

2. Linux is portable to any hardware platform:


A vendor who wants to sell a new type of computer and who doesn't know what kind of
OS his new machine will run (say the CPU in your car or washing machine), can take a
Linux kernel and make it work on his hardware, because documentation related to this
activity is freely available.
3. Linux was made to keep on running
As with UNIX, a Linux system expects to run without rebooting all the time. That is
why a lot of tasks are being executed at night or scheduled automatically for other calm
moments, resulting in higher availability during busier periods and a more balanced use
of the hardware.
4. Linux is secure and versatile:
The security model used in Linux is based on the UNIX idea of security, which is known
to be robust and of proven quality. But Linux is not only fit for use as a fort against
enemy attacks from the Internet: it will adapt equally to other situations, utilizing the
same high standards for security.
5. Linux is scalable:
From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of
nodes: add or remove the appropriate packages and Linux fits all. You don't need a

supercomputer anymore, because you can use Linux to do big things using the building
blocks provided with the system. If you want to do little things, such as making an
operating system for an embedded processor or just recycling your old 486, Linux will
do that as well.
6. The Linux OS and most Linux applications have very short debug-times:
Because Linux has been developed and tested by thousands of people, both errors and
people to fix them are usually found rather quickly. It sometimes happens that there are
only a couple of hours between discovery and fixing of a bug.

LINUX FILE SYSTEM


A file system is termed to be as a logical division within physical partition. The Linux file system
is similar like all UNIX systems which are based on one root directory, i.e. a hierarchical top
point with subdirectories under it. Some sub directories act as mount points, where different
physical or networked file systems may be included.
The files and directories are organized into a single-rooted inverted tree
structure. The names are case-sensitive, delimited by the /(forward slash)
character. Each shell and system process has a current directory

/bin contains executable programs, known as binaries. Which are essential system files. Many
Linux commands are actually programs found in this directory.
The /sbin directory is also used to store system binary files. Most of the files in this directory
are used for system administration purposes.
The /etc directory is very important and contains many of the Linux system configuration files.
These files provide all configuration settings to our Linux system. The password file passwd , is
found here, as is the list of file systems to mount at startup, fstab. Also, this directory contains the
startup scripts for Linux.
The /lib directory contains all the shared libraries which are used by various programs. By
using these many programs can reuse the same code and these libraries can be stored in a
common place, by reducing the size of our program at runtime.
The /dev directory contains special files known as the device files, which are used to access all
the different types of hardware on our system. For example /dev/lp0 for line printer, /dev/hda0
for hard drive partition and /dev/mouse for reading input from mouse.
By organizing access to hardware devices in this way, Linux effectively makes the interface to
a hardware device like any other piece of software.

The /proc directory is actually a virtual file system. It is used to read process information from
memory.
The /tmp directory is used to store temporary files that programs create when running. If we
have program that creates many large temporary files, we might want to mount the /tmp
directory as a separate file system rather than just as a directory on the root file system.
The /home directory is the base directory for the user home directories. It is common to mount
this directory as a separate file system so that users can have more and more for their files.
The /var directory holds files that tend to change in size over time. Typically, various system
log files are located below this directory.
The /usr directory and its subdirectories are very important to the operation of our Linux
system. This directory contains several subdirectories with some of most important programs in
our system. Typically, subdirectories of /usr contain the large software packages that we install.

Shell
A good command line interface (CLI) is a marvelously expressive way of communicating with a
computer. A command line can be referred as the shell. The shell is a program that takes
keyboard commands and passes them to the operating system to carry out.
Shell types:
Bourne Shell (sh) (First shell by Stephen Bourne)
C Shell(sh)
Korn Shell (ksh)
Bourne Again Shell(bash)
Almost all Linux distributions supply a shell program from the GNU Project called bash. When
using a graphical user interface, we need another program called a terminal emulator to interact
with the shell.
In order to work on a Linux system directly, you will need to provide a user name and password.
You always need to authenticate to the system.
To log in, make sure the mouse pointer is in the login window, provide your user name and
password to the system and press Enter.

After entering your user name/password combination, it can take a little while before the
graphical environment is started, depending on the CPU speed of your computer, on the software
you use and on your personal settings.
To continue, you will need to open a terminal window. This program can be found in the
Applications->Utilities-> System Tools or Internet menu, depending on what window manager
you are using. This tool is the shell, and when in graphical mode, we activate our shell by
opening a terminal window.
The terminal window is your control panel for the system. Almost everything that follows is
done using this simple but powerful text tool. A terminal window should always show a
command prompt when you open one. This terminal shows a standard prompt, which displays
the user's login name, and the current working directory, represented by the twiddle (~):
Once it comes up, we should see something like this:

[me@linuxbox ~]$
This is called a shell prompt and it will appear whenever the shell is ready to accept input. In the
above example, me will be your login name, linuxbox is the name of the machine you are
working on, and ~ is an indication of your current location in the file system. If the last character
of the prompt is a pound sign (#) rather than a dollar sign, the terminal session has superuser
privileges. This means either we are logged in as the root user or we selected a terminal emulator
that provides superuser (administrative) privileges.

Linux commands

File/Directory Basics
ls
List files
cp
Copy files
mv
Rename files
rm
Delete files
ln
Link files
cd
Change directory
pwd
Print current directory name
mkdir
Create directory
rmdir
Delete directory
File Viewing
cat
less
head
tail
nl
od
xxd
gv
xdvi

View files
Page through files
View file beginning
View file ending
Number lines
View binary data
View binary data
View Postscript/PDF files
View TeX DVI files

File Creation and Editing


emacs
Text editor
vim
Text editor
vi
Text editor
gedit
Text editor
umask
Set default file protections
soffice
Edit Word/Excel/PowerPoint docs
abiword
Edit Word documents
gnumeric
Edit Excel documents.
File Properties
stat
Display file attributes
wc
Count bytes/words/lines
du
Measure disk usage
file
Identify file types
touch
Change file timestamps
chown
Change file owner
chgrp
Change file group
chmod
Change file protections
chattr
Change advanced file attributes
lsattr
List advanced file attributes
File Location

find
slocate
which
whereis

Locate files
Locate files via index
Locate commands
Locate standard files

File Text Manipulation


grep
Search text for matching lines
cut
Extract columns
paste
Append columns
tr
Translate characters
sort
Sort lines
uniq
Locate identical lines
tee
Copy stdin to a file and
to
stdout simultaneously
File Compression
gzip
Compress files (GNU Zip)
compress
Compress files (Unix)
bzip2
Compress files (BZip2)
zip
Compress files (Windows Zip)
File Comparison
diff
Compare files line by line
comm
Compare sorted files
cmp
Compare files byte by byte
md5sum
Compute checksums
Disks and Filesystems
df
Show free disk space
mount
Make a disk accessible
fsck
Check a disk for errors
sync
Flush disk caches
Backups and Remote Storage
mt
Control a tape drive
dump
Back up a disk
restore
Restore a dump
tar
Read/write tape archives
cdrecord
Burn a CD
rsync
Mirror a set of files
Printing
lpr

Print files

lpq

View print queue

lprm

Remove print jobs

Spelling Operations
look

Look up spelling

aspell

Check spelling interactively

spell

Check spelling in batch

Processes
Ps

List all processes

List users processes

uptime

View the system load

top

Monitor processes

xload

Monitor system load

free

Display free memory

kill

Terminate processes

nice

Set process priorities

renice

Change process priorities

Scheduling Jobs
sleep

Wait for some time

watch

Run programs at set intervals

at

Schedule a job

crontab

Schedule repeated jobs

Hosts
uname

Print system information

hostname

Print the systems hostname

ifconfig

Set/display network information

host

Look up DNS

whois

Look up domain registrants

ping

Check if host is reachable

traceroute

View network path to a host

Networking
ssh

Securely log into remote hosts

telnet

Log into remote hosts

scp

Securely copy files between hosts

sftp

Securely copy files between hosts

ftp

Copy files between hosts

evolution

GUI email client

mutt

Text-based email client

mail

Minimal email client

mozilla

Web browser

lynx

Text-only web browser

wget

Retrieve web pages to disk

slrn

Read Usenet news

gaim

Instant messaging/IRC

talk

Linux/Unix chat

write

Send messages to a terminal

mesg

Prohibit talk/write

Audio and Video


grip

Play CDs and rip MP3s

xmms

Play audio files

cdparanoia

Rip audio

audacity

Edit audio

xcdroast

Burn CDs

You might also like