Professional Documents
Culture Documents
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.
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.
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.
/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
find
slocate
which
whereis
Locate files
Locate files via index
Locate commands
Locate standard files
Print files
lpq
lprm
Spelling Operations
look
Look up spelling
aspell
spell
Processes
Ps
uptime
top
Monitor processes
xload
free
kill
Terminate processes
nice
renice
Scheduling Jobs
sleep
watch
at
Schedule a job
crontab
Hosts
uname
hostname
ifconfig
host
Look up DNS
whois
ping
traceroute
Networking
ssh
telnet
scp
sftp
ftp
evolution
mutt
mozilla
Web browser
lynx
wget
slrn
gaim
Instant messaging/IRC
talk
Linux/Unix chat
write
mesg
Prohibit talk/write
xmms
cdparanoia
Rip audio
audacity
Edit audio
xcdroast
Burn CDs