Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Unix

The document provides an overview of the Unix file system, highlighting its hierarchical organization and key features such as the treatment of everything as a file. It details different types of files in Unix, including ordinary files, directories, special files, pipes, sockets, and symbolic links. The conclusion emphasizes the Unix file system's reliability, security, and its foundational role in modern operating systems despite its complexity.

Uploaded by

vhabna.deb174
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Unix

The document provides an overview of the Unix file system, highlighting its hierarchical organization and key features such as the treatment of everything as a file. It details different types of files in Unix, including ordinary files, directories, special files, pipes, sockets, and symbolic links. The conclusion emphasizes the Unix file system's reliability, security, and its foundational role in modern operating systems despite its complexity.

Uploaded by

vhabna.deb174
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

NAME: DHRUBO DEBNATH

STREAM: BCA

SEM: 6th

COLLEGE ROLL: 10422148

UNIVERSITY ROLL: 30601222131

PAPER NAME: UNIX AND SHELL PROGRAMMING

PAPER CODE: BCAC602

COLLEGE: NARULA INSTITUTE OF TECHNOLOGY


File Systems in Unix
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 the 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 Unix file system is a hierarchical file system used by Unix-
based operating systems to store and organize files and
directories. It is a tree-like structure that starts with a single
directory called the root directory, which is denoted by a
forward slash (/) character.
The Unix file system uses a directory hierarchy that allows for
easy navigation and organization of files. Directories can
contain both files and other directories, and each file or
directory has a unique name.
File on Unix Operating System:

 In Unix everything is treated as a file, even devices are


also treated as a special file.
 All devices are represented by files called special files
that are located in/dev directory.
 These are access in the same way as regular file.
 Device files have two categories: 1) Block Special File, 2)
Character Special File
 In Block Special File data gets transfer in terms of block.
So, it has characteristics similar to disk.
 In Character Special File data gets transfer by stream of
bits in sequential order like keyboard.
 Every file on a Unix System has a Unique Inode.
 Processes access files by well-defined set of system call.
 Files can be specified by a character string called as path
name.
 Each Pathname is unique and it is converted to an Inode.
Types of Unix Files
The UNIX files system contains several different types of files-

Ordinary Files
An ordinary file is a file on the system that contains data, text,
or program instructions.
 Used to store your information, such as some text you
have written or an image you have drawn. This is the
type of file that you usually work with.
 Always located within/under a directory file.
 Do not contain other files.
 In long-format output of ls -l, this type of file is specified
by the “-” symbol.
Directories
Directories store both special and ordinary files. For
users familiar with Windows or Mac OS, UNIX directories
are equivalent to folders. A directory file contains an
entry for every file and subdirectory that it houses. If
you have 10 files in a directory, there will be 10 entries
in the directory. Each entry has two components. (1) The
Filename (2) A unique identification number for the file
or directory (called the inode number)
 Branching points in the hierarchical tree.
 Used to organize groups of files.
 May contain ordinary files, special files or other
directories.
 Never contain “real” information which you would work
with (such as text). Basically, just used for organizing
files.
 All files are descendants of the root directory, (named /)
located at the top of the tree.
In long-format output of ls –l, this type of file is specified
by the “d” symbol.

Special Files
Used to represent a real physical device such as a
printer, tape drive or terminal, used for Input/Output
(I/O) operations. Device or special files are used for
device Input/Output(I/O) on UNIX and Linux systems.
They appear in a file system just like an ordinary file or a
directory. On UNIX systems there are two Flavors of
special files for each device, character special files and
block special files:
 When a character special file is used for device
Input/Output(I/O), data is transferred one character at a
time. This type of access is called raw device access.
 When a block special file is used for device
Input/Output(I/O), data is transferred in large fixed-size
blocks. This type of access is called block device access.

Pipes
UNIX allows you to link commands together using a pipe.
The pipe acts a temporary file which only exists to hold
data from one command until it is read by another. A
Unix pipe provides a one-way flow of data. The output
or result of the first command sequence is used as the
input to the second command sequence. To make a
pipe, put a vertical bar (|) on the command line
between two commands. For example: who | wc -l In
long-format output of ls –l, named pipes are marked by
the “p” symbol.
Sockets
A Unix socket (or Inter-process communication socket) is
a special file which allows for advanced inter-process
communication. A Unix Socket is used in a client-server
application framework. In essence, it is a stream of data,
very similar to network stream (and network sockets),
but all the transactions are local to the filesystem. In
long-format output of ls -l, Unix sockets are marked by
“s” symbol.

Symbolic Link
Symbolic link is used for referencing some other file of
the file system. Symbolic link is also known as Soft link. It
contains a text form of the path to the file it references.
To an end user, symbolic link will appear to have its own
name, but when you try reading or writing data to this
file, it will instead reference these operations to the file
it points to. If we delete the soft link itself, the data file
would still be there. If we delete the source file or move
it to a different location, symbolic file will not function
properly. In long-format output of ls –l , Symbolic link are
marked by the “l” symbol (that’s a lower case L).
Conclusion

In this article we discussed the Unix file system which is a


fundamental and enduring component of Unix-based
operating systems. Its hierarchical organization, robustness,
and security features make it a reliable choice for organizing
and managing data. While it offers compatibility and
flexibility, it can be complex and has a steep learning curve,
primarily relying on a command-line interface. Nonetheless,
it remains a cornerstone in the world of file systems,
continuing to serve as the foundation for modern operating
systems.

You might also like