What is Unix
What is Unix
Difference: the diiference between multi –tasking and multi-user system is,
• In multi-tasking, different tasks the process running concurrently
belongs to one user.
• In multi-user environment different tasks belong to diff users.
3. Portable
➢ Unix operating system is highly portable.
➢ Compared to other os, it is very easy to port.unix on to different
hardware platforms with minimal or no modifications at all i.e.,
because it ways developed in c language which is high level language
5. Security:
➢ As Unix is multi-user system, there is every chance that a user may
intrude into a another users area either unintentionally. But, Unix offers
solid security at various levels beginning from the system startup level to
accessing files as well as saving data in an encrypted form.
UNIX components:
Unix contains 3 major components.
1.The kernel
2. The shell
3. The file system.
1. The kernel:
➢ The kernel is the heart of any unix os.
➢ This kernel is relatively a small piece of code written in ‘c’ that is embedded
on the hardware.
➢ Every unix system has a kernel that gets automatically loaded on to the
memory as soon as system is boosted.
➢ The kernel is the only component that can communicate with all hardware
directly.
➢ Kernel manages all the system resources like memory and i/o devices
,allocated time between users and processes in the case of multi-user
environment, decides process priorities, manages inter process communication
and performs many other such tasks.
Monolithic kernels:
Earlier ,all the programs that were part of a kernel , were integrated, together
and moved onto the memory during booting. Such integrated kernels are referred to as,’
monolithic kernels’.
Micro kernel: Now -a-days ,all the programs are grouped into different modules and only
the just necessary module is moved on to the memory during boating. This just necessary
and sufficient module consisting of a small set of kernel program is called a “ micro kernel”
Shell:
Every unix system has atleast one shell.A shell is a program that sites on kernel and
acts as an agent or interface between the users and the kernel and hence the hardware.
A shell is a command interpreter or processor at which the user can type in any unix
command.
Types of shells:
There are different types of shells available. some of them are.
✓ C shell(csh):
• Bill joy , developed this shell at VCB as a part of the BSD release .
• It is called c shell because is syntax and usuage is very similar to the ‘c’
programming language .
✓ Korn shell(ksh):
• This shell was developed by david korn at AT &T bell labs.
• It has the both features of bourne shell and c shell and is one of the
widely used shells.
✓ Bourne-again shell(bash):
• This shell was developed by BFOX and C raney at free software
foundation.
• This is a free ware shell.
Unix file system is a logical method of organizing and storing large amounts of information in
a way that makes it easy to manage. A file is a smallest unit in which the information is
stored. Unix file system has several important features. All data in Unix is organized into
files. All files are organized into directories. These directories are organized into a tree-like
structure called the file system.
Files in Unix System are organized into multi-level hierarchy structure known as a directory
tree. At the very top of the file system is a directory called “root” which is represented by a
“/”. All other files are “descendants” of root.
/ : The slash / character alone denotes the root of the filesystem tree.
/bin : Stands for “binaries” and contains certain fundamental utilities, such as ls or cp, which
are generally needed by all users.
/boot : Contains all the files that are required for successful booting process.
/dev : Stands for “devices”. Contains file representations of peripheral devices and
pseudo-devices.
/etc : Contains system-wide configuration files and system databases. Originally also
contained “dangerous maintenance utilities” such as init,but these have typically been
moved to /sbin or elsewhere.
/lib : Contains system libraries, and some critical files such as kernel modules or device
drivers.
/mnt : Stands for “mount”. Contains filesystem mount points. These are used, for example, if
the system uses multiple hard disks or hard disk partitions. It is also often used for remote
(network) filesystems, CD-ROM/DVD drives, and so on.
/root : The home directory for the superuser “root” – that is, the system administrator. This
account’s home directory is usually on the initial filesystem, and hence not in /home (which
may be a mount point for another filesystem) in case specific maintenance needs to be
performed, during which other filesystems are not available. Such a case could occur, for
example, if a hard disk drive suffers physical failures and cannot be properly mounted.
/tmp : A place for temporary files. Many systems clear this directory upon startup; it might
have tmpfs mounted atop it, in which case its contents do not survive a reboot, or it might be
explicitly cleared by a startup script at boot time.
/usr : Originally the directory holding user home directories,its use has changed. It now holds
executables, libraries, and shared resources that are not system critical, like the X Window
System, KDE, Perl, etc. However, on some Unix systems, some user accounts may still
have a home directory that is a direct subdirectory of /usr, such as the default as in Minix.
(on modern systems, these user accounts are often related to server or system use, and not
directly used by a person).
/usr/bin : This directory stores all binary programs distributed with the operating system not
residing in /bin, /sbin or (rarely) /etc.
1. External commands:
A command with an independent existence in the form of a separate file is called an external
command.
Ex: cat and ls . these are independently existed in a directory called the / bin directory .
When external commands and given the shell reaches these command files with the help
of ‘PATH’ variable.
2. Internal commands:
A command that does not have an independent existence is called an
internal command.
Ex. Echo,mkdir,cd,etc;
The routines for internal commands will be a part of another program (or) routine.
Ex. Echo command is internal command will be a part of another program(or) routine
is the part of shell’s routine “sh”.