Beruflich Dokumente
Kultur Dokumente
ANDHRA PRADESH
Name : Gandi 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
Sub topic : UNIX commands
Teaching Aids : PPT, Animations, Photographs
CM304.7 1
Recap
CM304.7 2
Objective
CM304.7 3
What is find?
CM304.7 4
What is find?
Options:
-mtime n prints file names modified n
days ago
-mtime +n prints file names modified
>n days ago
-mtime –n prints file names modified
<n days ago
CM304.7 5
find
Options (continued)
-name pattern prints file names matching pattern
-perm mode prints file names matching
permissions
-size +nc prints file names >n bytes
CM304.7 6
find
Options (continued)
-size –nc prints file names <n bytes
-user username prints files owned by
username
-type c prints files of type c where c is:
“l” link
“f” text file
“d” directory
CM304.7 7
find Examples
CM304.7 8
find Examples
CM304.7 9
find Examples
CM304.7 10
find Examples
CM304.7 11
find Examples
CM304.7 12
The find Command
find is one of the power tool of the system.
It recursively examines a directory tree to look
for files either by
Name or by matching one or more file
attributes.
CM304.7 13
The find Command
Examples:
CM304.7 14
The wc Command
CM304.7 15
The wc Command Contd..
$wc jani
6 12 186 jani
The first number represents the number of
lines in the file,
the second represents number of words and
the third is the number of characters which is
CM304.7 16
Contd..
The wc Command
the file.
w option prints the number of words in
the file.
c option prints the number of characters
in the file.
$ wc –l jani $wc –w jani $wc –c jani
6 jani 12 jani 186 jani
CM304.7 17
The cmp command
file1 file2
It’s fun playing It’s fun
Playing
Cricket Cricket.
CM304.7 18
The cmp command Contd..
CM304.7 19
du – Disk Usage
CM304.7 20
The comm Command
CM304.7 21
Contd..
The comm Command
CM304.7 22
The comm Command
Contd..
CM304.7 23
The diff Command
CM304.7 24
The diff Command
Contd..
Example:
$ diff file1 file2
192
>4c5
<z
The word flagged by < belong to file1
The word flagged by > belong to file2
The lines 192 and 4c5 indicate how file can be
made to look like file1 file2
CM304.7 25
The diff Command
Contd..
a - stands for append
c - stands for change
d - stands for delete
Number before character refers to line number
in file.
Number after character refers to line number in
file2.
192 indicates that at the end of line number
one in file1,line no. 2 should be appended.
CM304.7 26
The banner command
CM304.7 27
The banner command
Contd..
Example;
$banner T T
####### #######
# #
# #
# #
# #
$banner “T T”
here output will be adjusted in to a single line
CM304.7 28
Summary
In this period you have learnt UNIX
commands like
find
wc
cmp
comm
diff
banner
CM304.7 29
Quiz
1.wc means……..
(a) list
(b) words
(c) word count
(d) none
CM304.7 30
Quiz
1.wc means……..
(a) list
(b) words
(c) word count
(d) none
CM304.7 31
Quiz
CM304.7 32
Quiz
CM304.7 33
Quiz
CM304.7 34
Quiz
CM304.7 35
Frequently asked questions
3. What is a wc?
CM304.7 36