Experiment 2 - Unix
Experiment 2 - Unix
Experiment # 2
Name: Raj Patel Rno: B264 Class: B. Tech C.E.
UNIX PROGRAMMING
a) $ ls [a –d]??
This function searches file name starting with a-d followed by any 2 characters only.
b) $ ls [a –z] [0 -9]
This function searches file name starting with a-z followed by 0-9.
c) $ ls –Rt
1
SVKM’s NMIMS
Mukesh Patel School of Technology Management &Engineering Shirpur Campus
Deparment of Computer Engineering
Instructor Manual Lab Manual Academic Year- 2020-21
Year:-Third Subject:- Unix Programming Semester:- Sixth
This function is used to show all the directories, sub-directories and files present in the
computer.
This function is used to create a directory called apple. It assigns 740 permission to the
owner, group and others respectively.
e) $ mkdir -p fruits/delicious/apple
2
SVKM’s NMIMS
Mukesh Patel School of Technology Management &Engineering Shirpur Campus
Deparment of Computer Engineering
Instructor Manual Lab Manual Academic Year- 2020-21
Year:-Third Subject:- Unix Programming Semester:- Sixth
This function is used to create a directory called fruits with a sub-directory called
delicious inside it. Delicious directory will have a dub-directory called apple.
This function is used to show the contents of the files mbacourse.txt and lawcourse.txt
h) $ rmdir -p fruits/delicious/apple
3
SVKM’s NMIMS
Mukesh Patel School of Technology Management &Engineering Shirpur Campus
Deparment of Computer Engineering
Instructor Manual Lab Manual Academic Year- 2020-21
Year:-Third Subject:- Unix Programming Semester:- Sixth
This function removes the directory and all its sub directories.
i) $ cp /fruits/delicious/apple/juice.txt college/students
j) $ rm –r college
k) $ mv mbacourse.txt management.txt
l) $ ln –f juice.txt energy.txt
This command is used to create a hard link or a symbolic link to an existing file or
directory.
m) $ finger Charlesfinger
4
SVKM’s NMIMS
Mukesh Patel School of Technology Management &Engineering Shirpur Campus
Deparment of Computer Engineering
Instructor Manual Lab Manual Academic Year- 2020-21
Year:-Third Subject:- Unix Programming Semester:- Sixth
This command is a user information lookup command which gives details of all the users
logged in.
Q-3 What is the use of bc command? Explain a few functions that are associated with it.
The bc command allows you to specify an input and output base for operations in decimal, octal,
or hexadecimal. The default is decimal. The command also has a scaling provision for decimal
point notation.
5
SVKM’s NMIMS
Mukesh Patel School of Technology Management &Engineering Shirpur Campus
Deparment of Computer Engineering
Instructor Manual Lab Manual Academic Year- 2020-21
Year:-Third Subject:- Unix Programming Semester:- Sixth
a) To show the contents of the file mbacourse.txt along with line numberings
6
SVKM’s NMIMS
Mukesh Patel School of Technology Management &Engineering Shirpur Campus
Deparment of Computer Engineering
Instructor Manual Lab Manual Academic Year- 2020-21
Year:-Third Subject:- Unix Programming Semester:- Sixth
d) To find the square root of the number 17( the result should be displayed up to five place
of decimals.
e) To remove the empty subdirectories, students and teachers, from the college directory.
Prerequisite:-
7
SVKM’s NMIMS
Mukesh Patel School of Technology Management &Engineering Shirpur Campus
Deparment of Computer Engineering
Instructor Manual Lab Manual Academic Year- 2020-21
Year:-Third Subject:- Unix Programming Semester:- Sixth
Outcome:-
After successful completion of this experiment students will be able to know about