Enrolment No.
Seat No..
UNIVERSITY
NATIONAL FORENSIC SCIENCES
Security-Semester - I —Examination
M.Sc. Digital Forensics and Inrorrnation
Ja n u a ry-2023
Date: 13/01/2023
Subject Code: CTMSDFIS Sl P4
Subject Name: Python Scripting Total Marks: 100
Time: 11:00 AM to 02:00 PM
Instructions:
l. Write down each question on separate page.
2. Attempt all questions.
3. Make suitable assumptions wherever necessary.
4. Figures to the right indicate full marks.
Marks
in Linux. 05
Q. I (a) Define shell. Explain the significance of the given directories
i) /usr ii) /bin iii) /etc 05
(b) Explain following commands with example.
(i) pwd (ii) cat (iii) Is (iv)mkdir (v) mv
shell with 07
(c) Explain different types of i/o redirects and expansion in bash
commands and proper syntax?
or
of chmod 07
(c) Explain different type of file permission in Linux? Write syntax
and chown command
05
Q.2 Explain following networking commands -
(a)
ping, netstat, wget, traceroute, ifconfig.
05
(b) Write shell script to find whether the number entered by user is even or odd.
(c) Explain Conditional Statements supported by bash with example 07
or
(c) Write an interactive bash script that accept starting and ending range 07
number from user and print all the numbers as below.
E.g., Enter starting Range: I
Enter ending Range: 5
12345
Q.3 (a) Write linux commands for following task — 08
(i) Write a commandto print the first 3 lines of "my_details" text file on
standard output.
(ii) Write a command to print the current work directory on console.
(iii) Write a command to list files of the current directory in long formatted
and sorted order.
(iv) Writea commandto give execute permissionto current user for tlsh
file.
(P.T.O)
Page 1 of2
the current directory to
(b) rite a shell script that display a list of all files in and deletes all lines
08
the user has read, write and execute perm issions as arouments to
containinga specified word in one or more files supplied
it.
Q.4 (a) Explaindifferent data types in python with suitable example
(b) Writea pyhon prograrn to find factorial of a number. 05
(c) Explainrequest tnodule of python with example. 07
or
(c) ExplainClasses, Objects and Constructor in python with suitable examples. 07
Q.5 (a) Explainslicing in python with various examples.
05
(b) Define cmdlet and discuss any 6 cmdlet of powershell.
(c) Defineexceptionhandling in python. Write a python script to throw a 05
user 07
defined exception when user add age less than 0 or more than 1 10.
or
(c) Writea short note on arithmetic operators used
in Powershell.
07
Q.6 (a) Whatis the usecaseof the
sys and os module of python
Explainany four functionsfrom os programming. 08
moduleand any four functions from
sys
(b) Create a class called
Shape which has three
Rectangle,Circle. Define one subclasses say Triangle,
method area() in the shape 08
this area() in these three class and override
subclasses to calculate for
area()of Trianglesubclass specific objects i.e.
should calculatearea of
triangle etc. Same ti»r
Triangle Area calculation
Formula—b*h/2
Rectangle Area calculation
Formula width
Circle Area calculation Formula -- •height
• Radius • Radius
(b) write bash
script for medical store list
and bill generation.
END OF PAPER 08
Page 2 of
2