Professional Documents
Culture Documents
EDUCATION
Name
ANDHRA: Gandi
PRADESH
Govinda Naidu
Designation : Head of Computer Engg Section
Branch : Computer Engg
Institute : Govt.Polytechnic for Women,
Bheemunipatnam
Year / Semester : III Semester
Subject : UNIX & C
Subject Code : CM-304
Topic : Basics of UNIX
Duration : 50 Min
SubTopic : UNIX directory commands
Teaching Aids : PPT, Animations, Photographs
CM304.6 1
Recap
CM304.6 2
Objectives
CM304.6 3
Directory
temp UNIX
dev
etc bin user
CM304.6 5
directory?
Files are grouped in the directory structure.
The file-system is arranged like hierarchical tree
(inverted)structure.
The top of the tree is called “root” which usually
contains several sub-directories.
In UNIX “/”(forward slash) is used to present the
“root”.
CM304.6 6
The pwd command
CM304.6 8
The cd command Contd..
$cd nagendra
/usr/nagendra
$cd /
$pwd
/
As shown above to move around in the file
system, cd command is used.
CM304.6 9
The ls command
The ls command is used to list the names of the
files in the directory.
When the user enters ls command an alphabetically
ordered listing of filenames will appear.
Example:
$ls
Address
Advance
Books
Prices
Staff
$ CM304.6 10
The ls command
Contd..
CM304.6 11
The ls command Contd..
$ls –l
total 5
-rw-rw-rw-1 nagendra 47 796 May 27 12:30 Addres
-rw-rw-rw- 1 nagendra 47 91 May 27 12:40 Advance
-rw-rw-rw- 1 nagendra 47 20 May 27 12:49 Books
-rw-rw-rw- 1 nagendra 47 89 May 27 12:00 Prize
-rw-rw-rw- 1 nagendra 47 123 May 27 12:09 Staff
CM304.6 12
The ls command Contd..
CM304.6 14
The ls command Contd..
in columns
CM304.6 15
The mkdir command
The mkdir command allow the user to create sub
directories. Let us consider the following
Example.
$pwd
/usr/nagendra Here the user is in /usr/nagendra
directory.
$mkdir jani here the user creating sub
directory jani under /usr/nagendra
CM304.6 16
The mkdir command Contd..
$cd jani
$pwd
$/usr/nagendra/jani
The mkdir command creates a sub directory.
However the current working directory does not
change to new directory.
CM304.6 17
The rmdir command
CM304.6 18
The rmdir command Contd..
Example:
$pwd
/usr/nagendra/jani
$cd ..
$pwd
/usr/nagendra
CM304.6 19
Summary
At the end of this class, you have learnt
UNIX file commands like
pwd – displaying present working directory.
cd – change directory
ls – list files/directory
mkdir – creates directory
rmdir – removes directory
CM304.6 20
Quiz
(a) copy
(b) move
(c) Present working directory
(d) Print document
CM304.6 21
Quiz
(a) copy
(b) move
(c) Present working directory
(d) Print document
CM304.6 22
Quiz
(a) copy
(b) concate
(c) cancel
(d) change
CM304.6 23
Quiz
(a) copy
(b) concate
(c) cancel
(d) change
CM304.6 24
Quiz
(a) remove
(b) rearrange
(c) repeat
(d) Remove empty
CM304.6 25
Quiz
(a) remove
(b) rearrange
(c) repeat
(d) Remove empty
CM304.6 26
Frequently asked questions
3. What is a pwd?
CM304.6 27