0% found this document useful (0 votes)
22 views14 pages

UNIX Seminar

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)
22 views14 pages

UNIX Seminar

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/ 14

Module :02

TOPIC :UNIX FILE SYSTEM

PREPARED BY:
NAME : ROSHAN KUMAR MAHATO
USN :1KN21CS085
SECTION : B
BRANCH : C.S.E SUBMITTED TO:
PROFESSOR DR.LEVINA
DEPARTMENT OF
CSE
THE FILE:
 Files are the building blocks of any operating system. When you
execute a command in UNIX, the UNIX kernel fetches the
corresponding executable file from a file system, loads its instruction
text to memory, and creates a process to execute the command on
your behalf.

 A file name is the complete title of a file and file extension.


For
example, “bibek.txt" is a complete file name. A file name
may also describe only the first portion of the file. For
example, “bibek" is the name of the file and ".txt" is its file
name extension.
Using absolute pathnames for a
command
An absolute path is defined as the specifying the location of a file
or directory from the root directory(/).
Example: date command can executed in two ways
as
$date // Relative path
Thu Sep 7 10:20:29 IST 2017
$/bin/date // Absolute path
Thu Sep 7 10:20:29 IST 2017
Directory command:

1. Pwd :print working directory


Checking your current directory User can move around from one
directory to another, but at any point of time, if user wants to find
out in which directory he is present then user can use Print
Working Directory(pwd) command.

Ex: pwd /home/Mahato/Roshan


pwd also displays the absolute pathname.
2. cd: Changing the current directory:

 User can move around the UNIX file system using cd (change
directory) command.
 When used with the argument, it changes the current directory to the
directory specified as argument, progs:

$ pwd
/home/kumar
$cd progs
$ pwd
/home/kumar/progs
3.mkdir:Making Directory

The mkdir command in Linux/Unix allows users to create


or make new directories. mkdir stands for “make directory.”
With mkdir , you can also set permissions, create multiple
directories (folders) at once, and much more.
You can create a number of subdirectories with one
mkdir command:

$mkdir patch dba doc


4. rmdir: Removing a Directory

 The directory must be empty before using rmdir with the


directory name.

Ex: rmdir pis


Multiple directories can be removed.
o Ex: $rmdir pis/data pis/progs pis

rmdir : Things to remember


• You can‘t remove a directory which is not empty
• You can‘t remove a directory which doesn‘t exist in system.
• You can‘t remove a directory if you don‘t have permission to
do so.
THE UNIX FILE SYSTEM:
The Unix file system is a methodology for logically organizing and
storing large quantities of data such that the system is easy to manage.

Basic file types/categories:


1. Ordinary (Regular) File.
2. Directory File.
3. Device File.
1. Ordinary (Regular) File:
 An ordinary file or regular file is the most common file type. All
programs you write belong to this type.
An ordinary file itself can be divided into two types: Text File.
Binary File.

Test file:
 A Text file contains only printable characters, and you can often
view the contents and make sense out of them. All C and Java
program sources, shell and perl scripts are
text files.
Binary file:
 A binary file, on the other hand, contains both printable and
unprintable characters that cover the entire ASCII range (0 to 255).
2. Directory File:

• The name of the File.


• An inode number, which is a unique identification number for the file
or directory.
• Branching points in the hierarchical tree.
• We use it to organize the collection of files.
• It contains special files, ordinary files or other directories.
• It does not contain "real" information that we would work with,
like text. Mostly, only need for organizing files.
• Each file is descendant of the root directory (named /) located at
the tree's top.
3. Device File:
You'll also be printing files, installing software from CD-ROMs or
backing up files to tape.

All of these activities are performed by reading or writing the file


representing the device.

Device file names are generally found inside a single directory


structure, /dev. A device file is indeed special, it's not really a
stream of characters. In fact, it doesn't contain anything at all.

It is advantageous to treat devices as files as some of the


commands used to access an ordinary file also work with device
files.
Parent-Child Relationship:

 The child process maintains a reference to its parent's PID.


 The parent process usually monitors its child's execution or
may interact with it through inter-process communication
(IPC) mechanisms.
 When the parent process terminates, the child process may be
"adopted" by the in it process (with PID 1), ensuring that
orphaned child processes are managed.
Command Summary:
• cat - display entire file(s) in the terminal window (also see more
commandbelow)
• cd - change the current directory (see bash-builtins note)
• cp - copy file(s)
• chmod - change file(s) protection modes
• lpr - send file(s) to the line printer
• mkdir - create (make) a new directory
• more - nicely view the contents of file(s)
• mv - move (and/or rename) file(s)
• pwd - print ablsoute pathname of current working directory
• rm - remove file(s)
• rmdir - remove an empty directory
• umask - set file mode creation mask
THANK YOU!

You might also like