0% found this document useful (0 votes)
21 views

Unit - 4

Uploaded by

sajal kar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Unit - 4

Uploaded by

sajal kar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

UNIT – 4

UNIX Operating System


INTRODUCTION
• UNIX is a powerful Operating System initially
developed by Ken Thompson, Dennis Ritchie at AT&T
Bell laboratories in 1970.

• It is prevalent among scientific, engineering, and


academic institutions due to its most appreciative
features like multitasking, flexibility, and many more.

• In UNIX, the file system is a hierarchical structure of


files and directories where users can store and
retrieve information using the files.
INTRODUCTION
• It was originally meant for programmers developing
software rather than non-programmers.

• The Unix operating system is a set of programs that


act as a link between the computer and the user.

• There are various Unix variants available in the


market.

• Solaris Unix, AIX, HP Unix and BSD are a few


examples. Linux is also a flavor of Unix which is freely
available.
Features of UNIX Operating System:
Features of UNIX Operating System:
• Multitasking: A UNIX operating system is a
multitasking operating system that allows you to
initiate more than one task from the same terminal
so that one task is performed as a foreground and
the other task as a background process.

• Multi-user: UNIX operating system supports more


than one user to access computer resources like
main memory, hard disk, tape drives, etc. Multiple
users can log on to the system from different
terminals and run different jobs that share the
resources of a command terminal.
Features of UNIX Operating System:
• Portability: This feature makes the UNIX work on different
machines and platforms with the easy transfer of code to
any computer system. Since a significant portion of UNIX
is written in C language, and only a tiny portion is coded in
assembly language for specific hardware.

• File Security and Protection: Being a multi-user system,


UNIX makes special consideration for file and system
security. UNIX has different levels of security using
assigning username and password to individual users
ensuring the authentication, at the level providing file
access permission viz. read, write and execute and lastly
file encryption to change the file into an unreadable
format.
Features of UNIX Operating System:
• Command Structure: UNIX commands are easy to
understand and simple to use. Example: "cp", mv etc.
While working in the UNIX environment, the UNIX
commands are case-sensitive and are entered in
lower case.

• Communication: In UNIX, communication is an


excellent feature that enables the user to
communicate worldwide. It supports various
communication facilities provided using the write
command, mail command, talk command, etc.
Features of UNIX Operating System:
• Open Source: UNIX operating system is open source
it means it is freely available to all and is a
community-based development project.

• Accounting: UNIX keeps an account of jobs created


by the user. This feature enhances the system
performance in terms of CPU monitoring and disk
space checking. It allows you to keep an account of
disk space used by each user, and the disk space can
be limited by each other. You can assign every user a
different disk quota. The root user can perform these
accounting tasks.
Features of UNIX Operating System:
• UNIX Tools and Utilities: UNIX system provides
various types of tools and utilities facilities such as
grep, sed and awk, etc. Some of the general-purpose
tools are compilers, interpreters, network
applications, etc. It also includes various server
programs which provide remote and administration
services.
The structure of Unix OS
The structure of Unix OS

• Kernel −
– The kernel is the heart of the operating system.
– It interacts with the hardware and most of the tasks like
memory management, task scheduling and file
management.

• Shell −
– The shell is the utility that processes your requests.
– When you type in a command at your terminal, the shell
interprets the command and calls the program that you
want.
– The shell uses standard syntax for all commands. C Shell,
Bourne Shell and Korn Shell are the most famous shells
which are available with most of the Unix variants.
The structure of Unix OS

• Shell −
– Bourne Shell: This Shell is simply called the Shell. It
was the first Shell for UNIX OS. It is still the most
widely available Shell on a UNIX system.
– C Shell: The C shell is another popular shell
commonly available on a UNIX system. The C shell
was developed by the University of California at
Berkeley and removed some of the shortcomings of
the Bourne shell.
– Korn Shell: This Shell was created by David Korn to
address the Bourne Shell's user-interaction issues
and to deal with the shortcomings of the C shell's
scripting quirks.
The structure of Unix OS

• Commands and Utilities −


– There are various commands and utilities which you can make use of
in your day to day activities.
– cp, mv, cat and grep, etc. are few examples of commands and
utilities.
– There are over 250 standard commands plus numerous others
provided through 3rd party software. All the commands come along
with various options.
• Files and Directories −
– All the data of Unix is organized into files.
– All files are then organized into directories.
– These directories are further organized into a tree-like structure
called the filesystem.
UNIX File System

• A file system is a logical collection of files on a


partition or disk.
• A partition is a container for information and
can span an entire hard drive if desired.
• One file system per partition allows for the
logical maintenance and management of
differing file systems.
• Everything in Unix is considered to be a file,
including physical devices such as DVD-ROMs,
USB devices, and floppy drives.
UNIX File System

• In UNIX, the file system is a hierarchical


structure of files and directories where users
can store and retrieve information using the
files.
• All the files in the UNIX system are related to
one another.
• Unix uses a hierarchical file system structure,
much like an upside-down tree, with root (/)
at the base of the file system and all other
directories spreading from there.
UNIX File System
UNIX File System
Directories and Description

• / - This is the root directory which should


contain only the directories needed at the top
level of the file structure.
• /bin - This is where the executable files are
located. These files are available to all users.
• /dev - These are device drivers.
• /etc - Supervisor directory commands,
configuration files, disk configuration files, valid
user lists, groups, ethernet, hosts, where to
send critical messages.
UNIX File System
Directories and Description

• /lib - Contains shared library files and


sometimes other kernel-related files.
• /boot - Contains files for booting the system.
• /home - Contains the home directory for users
and other accounts.
• /mnt - Used to mount other temporary file
systems, such as cdrom and floppy for the CD-
ROM drive and floppy diskette drive,
respectively.
UNIX File System
Directories and Description

• /proc - Contains all processes marked as a file


by process number or other information that is
dynamic to the system.
• /tmp - Holds temporary files used between system
boots.
• /usr - Used for miscellaneous purposes, and can be
used by many users. Includes administrative
commands, shared files, library files, and others.
• /var - Typically contains variable-length files such as
log and print files and any other type of file that may
contain a variable amount of data.
UNIX File System
Directories and Description

• /sbin - Contains binary (executable) files,


usually for system administration. For
example, fdisk and ifconfig utlities.

• /kernel - Contains kernel files.


File Oriented Commands

ls command in Unix
• It is a command line utility that lists the
content/files listed in a particular Unix
directory.
• ls command with no parameters displays the
files listed in your current working directory.
• With ls command, you can add one or more
modifiers to get additional information.
– List contents of a directory
– ls is a command to list computer files in Unix
File Oriented Commands

ls command in Unix
• Syntax: ls [option] [filenames]
Command Use
ls -a Displays all files including hidden files
Long listing- The default output of the ls command
shows only the names of the files and directories. The
-l option shows files in a long listing format with
ls -l details like file type, file permissions, Number of hard
links to the file, file owner, file group, file size, Date
and Time, file name.

ls -i Displays list of directory contents with inode number


ls -r Lists directory contents in reverse order.
ls -t Sort the data by modification date
File Oriented Commands

cat command in Unix


• The cat (“concatenate“) command is one of
the most frequently used command in Unix.
• cat command allows us to create single or
multiple files, view content of file,
concatenate files and redirect output in
terminal or files.
• It reads data from the file and gives their
content as output.
File Oriented Commands

cat command in Unix


• Syntax: cat [option...] [file ...]
Item Description

-b Omits line numbers from blank lines.

-e Displays a $ (dollar sign) at the end of each line.

-n Displays output lines preceded by line numbers, numbered sequentially from 1.

Does not display a message if the cat command cannot find an input file. This flag is
-q
identical to the -s flag.

-r Replaces multiple consecutive empty lines with one empty line.

-s Does not display a message if the cat command cannot find an input file.
File Oriented Commands

cat command in Unix


Examples
• To display a file: cat notes
• To concatenate several files:
cat section1.1 section1.2 section1.3 >section1
• To append one file to the end of another:
cat section1.4 >> section1
File Oriented Commands

cat command in Unix


Examples
• To add text to the end of a file:
cat >>notes Get milk on the way home Ctrl-D
• Create a New File: cat >test1.txt
The cursor moves to a new line where you can
add the wanted text. Type a simple sentence
such as: This is test file
– To exit the prompt and write the changes to the
file, hold the Ctrl key and press d.

You might also like