SlideShare a Scribd company logo
3
Most read
5
Most read
7
Most read
UNIX
INTRODUCTION
• UNIX is one of the oldest operating systems, which is a multi-user and
multi-tasking system.
• The UNIX OS is basically written in C programming language. Under UNIX,
the operating system consists of many utilities along with the master
control program, called as the kernel.
• The kernel provides services to start and stop programs, handles the file
system and other common "low-level" tasks that most programs share, and
schedules access to avoid conflicts when programs try to access the same
resource or device simultaneously.
• To mediate such access, the kernel has special rights, reflected in the
division between user space and kernel space. The user interacts with a
UNIX system through a command interpreter known as the shell.
HISTORY
• In the mid – 1960’s, the Massachusetts Institute of Technology (MIT),
Bell Labs, and General Electric (GE) were trying to develop a time-
sharing OS called as Multics (Multiplexed Information and Computer
Services) for GE-645 mainframe.
• Because of the complexity of intended OS Multics, they dropped the
project. But, few researchers like Dennis Ritchie, Ken Thompson, Brian
Kernighan decided to redo the work in a smaller scale.
• They initially named it as Unics (Uniplexed Information and Computer
Services), and eventually, it was renamed as UNIX.
• In 1972, the UNIX was re-written in C language, migrating from
assembly level language. This helped UNIX for serving more
computing environments.
• During late 1970’s and early 1980’s, UNIX became available for
commercial purposes apart from earlier scientific environment. It
kept on taking different forms over the years, and in 1990’s many
UNIX – like systems came into existence, such as Linux.
ARCHITECTURE
• The UNIX system is supported by several simple but useful components. The important
components which embody UNIX OS architecture are discussed here.
• Division of Labor: Kernel and Shell
• Kernel: The kernel is also known as operating system.
• It interacts with the hardware of the machine. The kernel is the core of OS and it is a
collection of routines/functions written in C.
• Kernel is loaded into memory when the system is booted and communicates with the
hardware.
• The application programs access the kernel through a set of functions called as system
calls.
• The kernel manages various OS tasks like memory management, process scheduling,
deciding job priorities etc.
• Even if none of the user programs are running, kernel will be working in a background.
• Shell: The shell interacts with the user. It acts as a command
interpreter to translate user’s command into action.
• It is actually an interface between user and the kernel. Even though
there will be only one kernel running, multiple shells will be active –
one for each user.
• When a command is given as input through the keyboard, the shell
examines the command and simplifies it and then communicates with
the kernel to see that the command is executed.
• The shell is represented by sh (Bourne Shell), csh (C Shell), ksh (Korn
shell), bash (Bash shell).
The relationship between kernel and shell is shown in Figure
The File and Process
• File: A file is an array of bytes and it can contain any data. Various files
are related to each other by a hierarchical structure. Even a user (user
name) is placed in this file system. UNIX considers directories and the
devices also as the members of file system. In UNIX, the major file
type is text and the behavior of UNIX is controlled mainly by text files.
UNIX provides various text manipulation tools through which the files
can be edited without using an editor. x
• Process: A processing a program under execution. Processes are also
belonging to separate hierarchical structure. A process can be created
and destroyed. UNIX provides tools to the user to control the
processes, move them between foreground and background and to
kill them.
. UNIX FILE SYSTEM
• File system is one of the important pillars of UNIX system. UNIX treats
everything (even a user, program, directory etc) as a file. Hence,
organizing and managing the file system is very important topic to
study. Here, we will discuss how to create directories, moving around
the file system, listing filenames, various file attributes, security
related issues like file permission, changing the file permission etc.
THE FILE
• The file is a container for storing information. Unlike old DOS files, a
UNIX file does not contain eof (end-of-file) character. It contains only
the information stored by the user. All the attributes of a file are kept
in a separate area of the hard disk, which can be accessible by only
the kernel. UNIX treats directories and devices also as files. Even the
physical devices like hard disk, memory, CD-ROM, printer, modem etc.
are treated as files.
• In UNIX, files are divided into three categories –
• Ordinary file
• Directory file
• Device file
Ordinary (Regular) File
• It is a most common type of file that contains only data as a stream of
characters. An ordinary file can be one among these –
• Text file: contains only printable characters. Source codes of programming
languages like C, Java, C++, Perl, Shell script etc. are all text files. A text file
contains lines of characters where every line is terminated with a newline
character – known as linefeed (LF). Whenever you press [Enter] key while
inserting text into a file, the LF character is appended. One cannot see this
character, but it can be made visible using the command od.
• Binary file: contains both printable and non-printable characters covering
entire ASCII (0 – 255) set. The object codes, executable files etc. created by
compiling C language are binary files. Most of the UNIX commands are
binary files. Image/audio/video files are binary files. Trying to display the
contents of such files using simple cat command would produce
unreadable output.
Directory File
• A directory contains no data, but it keeps some information about the
files and subdirectories that it contains.
• The UNIX file system is organized with a number of directories and
subdirectories.
• A user also can create them, as and when required. Usually, a group
of related files are kept in a single directory.
• Sometimes, files with same name are kept in different directories.
• A directory file contains an entry for every file and subdirectory it has.
Each such entry has two components viz. –
• The filename
• A unique identification number for the file or directory (called as the
inode number)
• Thus, a directory actually do not contain the file itself, rather, it
contains only the file name and a number. One cannot write into a
directory file. But, the actions like creating a file, removing a file etc.
makes kernel to update the corresponding directory by
creating/removing filename and inode number associated with that
file.
Device File
• The activities like printing files, installing softwares from CD-ROM,
taking backup of files into a tape/drive etc. are performed by reading
or writing the file representing the device.
• For example, when you are printing a file in a printer, you are writing
a file associated with printer. Device filenames are generally found
inside a single directory structure, /dev.
• A device file is not a stream of characters. In fact, it does not contain
anything. The operation of a device is completely managed by the
attributes of its associated file. The kernel identifies a device from its
attributes and then uses them to operate the device
WHAT IS IN A FILE NAME?
• In most of the UNIX systems now a days, a filename can consists of
255 characters. They can have any printable and non-printable
characters except / and the NULL character. But, as UNIX uses special
characters like $, ?, *, &, ` etc for different purpose, it is better to
avoid certain characters. So, ideally, a filename can contain alphabets,
digits and special characters dot (.), hyphen (-) and underscore (_).
• UNIX does not impose any rule for framing the extensions for
filenames. Even shell scripts do not require .sh as extension. It is used
only for the convention. But, underlying programming languages like
C requires extension. Hence, in UNIX, a filename can contain any
number of dots – say, a.b.c.d.e is a valid filename in UNIX. A filename
can begin/end with a dot. But, UNIX is case sensitive and same is
maintained in naming the files as well. Thus, test, Test, TEST all are
different files.
THE PARENT – CHILD RELATIONSHIP
• All files in UNIX are related to each other. The file system in UNIX is a
collection of all types (ordinary, directory and device files) related files
organized in a hierarchical structure. A UNIX file system has root
represented by /, which serves as reference point for all files. The root
is actually a directory and it is different from the user-id root used by
the system admin to log-in.
• The root directory (/) has a number of subdirectories under it. These
subdirectories in turn have more subdirectories and files under them.
Figure 2.1 shows an example of UNIX file system tree structure. Here,
bin, dev etc. are directories under root (/). And, mthomas, stu1 are
subdirectories under home.
unix details file system, architecture, directory
THE HOME DIRECTORY
• When a user logs into the system, UNIX places him into a directory called as
home directory. It is created by the system when a user account is opened. If you
have logged in with a user name john, then, your home directory would be
/home/john. This can be viewed using the shell variable $HOME as –
• $echo $HOME
• /home/john # the first / represents root directory
• The path displayed here is known as absolute pathname, which is a sequence of
all directory names separated by slash (/) starting from root. A file foo located in a
home directory of the user can be referred as $HOME/foo. In some of the shells,
it can be referred as ~/foo. Here, the ~ symbol can be used to refer any other’s
file also. For example, if there is a file called foo in another user richard’s
directory also, then it can be referred as ~richard/foo.
unix details file system, architecture, directory

More Related Content

PPTX
Introduction to Unix
Nishant Munjal
 
PDF
Summarized of UNIX Time Sharing System
Shuya Osaki
 
PPTX
Unix operating system architecture with file structure
amol_chavan
 
PPTX
Unix / Linux Operating System introduction.
poongothai11
 
PPT
Module1-UNIX architecture; FEATURES OF UNIX OS
RAVIRAJ P
 
PPTX
Shells commands, file structure, directory structure.pptx
SherinRappai
 
DOC
84640411 study-of-unix-os
homeworkping3
 
Introduction to Unix
Nishant Munjal
 
Summarized of UNIX Time Sharing System
Shuya Osaki
 
Unix operating system architecture with file structure
amol_chavan
 
Unix / Linux Operating System introduction.
poongothai11
 
Module1-UNIX architecture; FEATURES OF UNIX OS
RAVIRAJ P
 
Shells commands, file structure, directory structure.pptx
SherinRappai
 
84640411 study-of-unix-os
homeworkping3
 

Similar to unix details file system, architecture, directory (20)

DOC
Introduction to unix
Chandru Jangin
 
DOCX
Introduction to unix
sudheer yathagiri
 
PPTX
Unix and shell programming | Unix File System | Unix File Permission | Blocks
LOKESH KUMAR
 
PPTX
Unix case-study
NishantMishra126
 
PDF
Introduction to Unix-like systems (Part I-IV)
hildenjohannes
 
PPT
2ab. UNIX files.ppt JSS science and technology university
tempemailtemp19
 
PPTX
MODULE 3.1 updated-18cs56.pptx
ManasaPJ1
 
PPTX
Introduction to Unix Concets.pptx
Harsha Patil
 
PPTX
Introduction to Unix Concets.pptx
Harsha Patil
 
PDF
Unix
Sudharsan S
 
PPTX
Operating systems unix
Achu dhan
 
PPT
Karkha unix shell scritping
chockit88
 
DOC
computer notes - Unix primer
ecomputernotes
 
PPT
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Sowmya Jyothi
 
PPT
Spsl unit1
Sasidhar Kothuru
 
PPTX
Unix Operating System
subhsikha
 
PPTX
CHAPTER 1 INTRODUCTION TO UNIX.pptx
MahiDivya
 
PDF
The unix file system
gsandeepmenon
 
PPTX
UNIX.pptx
P S Rani
 
PPT
Linux: Basics OF Linux
Omkar Walavalkar
 
Introduction to unix
Chandru Jangin
 
Introduction to unix
sudheer yathagiri
 
Unix and shell programming | Unix File System | Unix File Permission | Blocks
LOKESH KUMAR
 
Unix case-study
NishantMishra126
 
Introduction to Unix-like systems (Part I-IV)
hildenjohannes
 
2ab. UNIX files.ppt JSS science and technology university
tempemailtemp19
 
MODULE 3.1 updated-18cs56.pptx
ManasaPJ1
 
Introduction to Unix Concets.pptx
Harsha Patil
 
Introduction to Unix Concets.pptx
Harsha Patil
 
Operating systems unix
Achu dhan
 
Karkha unix shell scritping
chockit88
 
computer notes - Unix primer
ecomputernotes
 
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Sowmya Jyothi
 
Spsl unit1
Sasidhar Kothuru
 
Unix Operating System
subhsikha
 
CHAPTER 1 INTRODUCTION TO UNIX.pptx
MahiDivya
 
The unix file system
gsandeepmenon
 
UNIX.pptx
P S Rani
 
Linux: Basics OF Linux
Omkar Walavalkar
 
Ad

Recently uploaded (20)

PDF
5 Influence line.pdf for structural engineers
Endalkazene
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PPTX
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
dhanashri894551
 
PDF
B.Tech Data Science Program (Industry Integrated ) Syllabus
rvray078
 
PDF
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
ijcncjournal019
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PPTX
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PDF
Queuing formulas to evaluate throughputs and servers
gptshubham
 
PPTX
Simulation of electric circuit laws using tinkercad.pptx
VidhyaH3
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
ghousebhasha2007
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
Principles of Food Science and Nutritions
Dr. Yogesh Kumar Kosariya
 
PDF
Activated Carbon for Water and Wastewater Treatment_ Integration of Adsorptio...
EmilianoRodriguezTll
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PPTX
TE-AI-Unit VI notes using planning model
swatigaikwad6389
 
5 Influence line.pdf for structural engineers
Endalkazene
 
Software Testing Tools - names and explanation
shruti533256
 
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
dhanashri894551
 
B.Tech Data Science Program (Industry Integrated ) Syllabus
rvray078
 
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
ijcncjournal019
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Queuing formulas to evaluate throughputs and servers
gptshubham
 
Simulation of electric circuit laws using tinkercad.pptx
VidhyaH3
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
ghousebhasha2007
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
Principles of Food Science and Nutritions
Dr. Yogesh Kumar Kosariya
 
Activated Carbon for Water and Wastewater Treatment_ Integration of Adsorptio...
EmilianoRodriguezTll
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
TE-AI-Unit VI notes using planning model
swatigaikwad6389
 
Ad

unix details file system, architecture, directory

  • 2. INTRODUCTION • UNIX is one of the oldest operating systems, which is a multi-user and multi-tasking system. • The UNIX OS is basically written in C programming language. Under UNIX, the operating system consists of many utilities along with the master control program, called as the kernel. • The kernel provides services to start and stop programs, handles the file system and other common "low-level" tasks that most programs share, and schedules access to avoid conflicts when programs try to access the same resource or device simultaneously. • To mediate such access, the kernel has special rights, reflected in the division between user space and kernel space. The user interacts with a UNIX system through a command interpreter known as the shell.
  • 3. HISTORY • In the mid – 1960’s, the Massachusetts Institute of Technology (MIT), Bell Labs, and General Electric (GE) were trying to develop a time- sharing OS called as Multics (Multiplexed Information and Computer Services) for GE-645 mainframe. • Because of the complexity of intended OS Multics, they dropped the project. But, few researchers like Dennis Ritchie, Ken Thompson, Brian Kernighan decided to redo the work in a smaller scale. • They initially named it as Unics (Uniplexed Information and Computer Services), and eventually, it was renamed as UNIX.
  • 4. • In 1972, the UNIX was re-written in C language, migrating from assembly level language. This helped UNIX for serving more computing environments. • During late 1970’s and early 1980’s, UNIX became available for commercial purposes apart from earlier scientific environment. It kept on taking different forms over the years, and in 1990’s many UNIX – like systems came into existence, such as Linux.
  • 5. ARCHITECTURE • The UNIX system is supported by several simple but useful components. The important components which embody UNIX OS architecture are discussed here. • Division of Labor: Kernel and Shell • Kernel: The kernel is also known as operating system. • It interacts with the hardware of the machine. The kernel is the core of OS and it is a collection of routines/functions written in C. • Kernel is loaded into memory when the system is booted and communicates with the hardware. • The application programs access the kernel through a set of functions called as system calls. • The kernel manages various OS tasks like memory management, process scheduling, deciding job priorities etc. • Even if none of the user programs are running, kernel will be working in a background.
  • 6. • Shell: The shell interacts with the user. It acts as a command interpreter to translate user’s command into action. • It is actually an interface between user and the kernel. Even though there will be only one kernel running, multiple shells will be active – one for each user. • When a command is given as input through the keyboard, the shell examines the command and simplifies it and then communicates with the kernel to see that the command is executed. • The shell is represented by sh (Bourne Shell), csh (C Shell), ksh (Korn shell), bash (Bash shell).
  • 7. The relationship between kernel and shell is shown in Figure
  • 8. The File and Process • File: A file is an array of bytes and it can contain any data. Various files are related to each other by a hierarchical structure. Even a user (user name) is placed in this file system. UNIX considers directories and the devices also as the members of file system. In UNIX, the major file type is text and the behavior of UNIX is controlled mainly by text files. UNIX provides various text manipulation tools through which the files can be edited without using an editor. x
  • 9. • Process: A processing a program under execution. Processes are also belonging to separate hierarchical structure. A process can be created and destroyed. UNIX provides tools to the user to control the processes, move them between foreground and background and to kill them.
  • 10. . UNIX FILE SYSTEM • File system is one of the important pillars of UNIX system. UNIX treats everything (even a user, program, directory etc) as a file. Hence, organizing and managing the file system is very important topic to study. Here, we will discuss how to create directories, moving around the file system, listing filenames, various file attributes, security related issues like file permission, changing the file permission etc.
  • 11. THE FILE • The file is a container for storing information. Unlike old DOS files, a UNIX file does not contain eof (end-of-file) character. It contains only the information stored by the user. All the attributes of a file are kept in a separate area of the hard disk, which can be accessible by only the kernel. UNIX treats directories and devices also as files. Even the physical devices like hard disk, memory, CD-ROM, printer, modem etc. are treated as files.
  • 12. • In UNIX, files are divided into three categories – • Ordinary file • Directory file • Device file
  • 13. Ordinary (Regular) File • It is a most common type of file that contains only data as a stream of characters. An ordinary file can be one among these – • Text file: contains only printable characters. Source codes of programming languages like C, Java, C++, Perl, Shell script etc. are all text files. A text file contains lines of characters where every line is terminated with a newline character – known as linefeed (LF). Whenever you press [Enter] key while inserting text into a file, the LF character is appended. One cannot see this character, but it can be made visible using the command od. • Binary file: contains both printable and non-printable characters covering entire ASCII (0 – 255) set. The object codes, executable files etc. created by compiling C language are binary files. Most of the UNIX commands are binary files. Image/audio/video files are binary files. Trying to display the contents of such files using simple cat command would produce unreadable output.
  • 14. Directory File • A directory contains no data, but it keeps some information about the files and subdirectories that it contains. • The UNIX file system is organized with a number of directories and subdirectories. • A user also can create them, as and when required. Usually, a group of related files are kept in a single directory. • Sometimes, files with same name are kept in different directories.
  • 15. • A directory file contains an entry for every file and subdirectory it has. Each such entry has two components viz. – • The filename • A unique identification number for the file or directory (called as the inode number) • Thus, a directory actually do not contain the file itself, rather, it contains only the file name and a number. One cannot write into a directory file. But, the actions like creating a file, removing a file etc. makes kernel to update the corresponding directory by creating/removing filename and inode number associated with that file.
  • 16. Device File • The activities like printing files, installing softwares from CD-ROM, taking backup of files into a tape/drive etc. are performed by reading or writing the file representing the device. • For example, when you are printing a file in a printer, you are writing a file associated with printer. Device filenames are generally found inside a single directory structure, /dev. • A device file is not a stream of characters. In fact, it does not contain anything. The operation of a device is completely managed by the attributes of its associated file. The kernel identifies a device from its attributes and then uses them to operate the device
  • 17. WHAT IS IN A FILE NAME? • In most of the UNIX systems now a days, a filename can consists of 255 characters. They can have any printable and non-printable characters except / and the NULL character. But, as UNIX uses special characters like $, ?, *, &, ` etc for different purpose, it is better to avoid certain characters. So, ideally, a filename can contain alphabets, digits and special characters dot (.), hyphen (-) and underscore (_).
  • 18. • UNIX does not impose any rule for framing the extensions for filenames. Even shell scripts do not require .sh as extension. It is used only for the convention. But, underlying programming languages like C requires extension. Hence, in UNIX, a filename can contain any number of dots – say, a.b.c.d.e is a valid filename in UNIX. A filename can begin/end with a dot. But, UNIX is case sensitive and same is maintained in naming the files as well. Thus, test, Test, TEST all are different files.
  • 19. THE PARENT – CHILD RELATIONSHIP • All files in UNIX are related to each other. The file system in UNIX is a collection of all types (ordinary, directory and device files) related files organized in a hierarchical structure. A UNIX file system has root represented by /, which serves as reference point for all files. The root is actually a directory and it is different from the user-id root used by the system admin to log-in. • The root directory (/) has a number of subdirectories under it. These subdirectories in turn have more subdirectories and files under them. Figure 2.1 shows an example of UNIX file system tree structure. Here, bin, dev etc. are directories under root (/). And, mthomas, stu1 are subdirectories under home.
  • 21. THE HOME DIRECTORY • When a user logs into the system, UNIX places him into a directory called as home directory. It is created by the system when a user account is opened. If you have logged in with a user name john, then, your home directory would be /home/john. This can be viewed using the shell variable $HOME as – • $echo $HOME • /home/john # the first / represents root directory • The path displayed here is known as absolute pathname, which is a sequence of all directory names separated by slash (/) starting from root. A file foo located in a home directory of the user can be referred as $HOME/foo. In some of the shells, it can be referred as ~/foo. Here, the ~ symbol can be used to refer any other’s file also. For example, if there is a file called foo in another user richard’s directory also, then it can be referred as ~richard/foo.