You are on page 1of 15

USN

19CSE35

New Horizon College of Engineering, Bangalore


Autonomous College afiliated to VTU, Accredited by NAAC with A" Grade & NBA

Make-up Examination July 2021

UNIX SYSTEM PROGRAMMING


Duration:S hs Max. Marks: 100
Answer five full questions choosing one complete question from each module.

Module 1 Marks RBT CO


aDesceribe the architecture of UNIX operating system with a neat diagram and explain the 10 L2 COi
role ot kernel and the shell in sharing the labour.

Using the error status codes of APls, explain all the values of the global variable errmo that 12 CO1
could be applied.
OR
2a) Explain the efects caused by the various feature test macros if defined in the system L2 CO1
b) Explain the salient features of Unix Os L2 COI

Module 2
a) ustrate with example about the diferent categories of files and show how they can be CO2
created and deleted
bWhen the command ls -l is executed on a file atxt,the following output was obtained L3 CO2
dev 16 Aug 6 12:43 atxt
w-w cse

Apply the necessary commands which will give the following output
rwxrw-2 ise testing 18 Oct 16:40 a.txt
OR
4a)lustratewith necessary commands how to ensure that all fles created by users will have L3 CO2
the command to do this
thedefault permissions rwfApply your knowiedge identify
Kind ot modification with proper explanation of
to
the sgnificance of the identified

commands
b na directory called progs,with permission string as drwxr-xr-x,the following command is 10 L3 co2
executed in sequence
chmod a-t progs

Is progs
ca progs

Which all commands throw an error?Justify your answer with proper explanation
Module 3

Analyze the generic set of APls that can be used to manipulate more than one type of files 10 L4 CO3

L4 CO3
Analyze how to use access modifier flags with the access mode flags to alier the access
mechanism of the file using open function.
Examine the importance of fentl APl with the possible cmd values and also explain how co3
the control of a file can
access
changed

Page2
2of 2
19CSE35

OR
6a) Analyze how to create the block device file named /dev/bdsk with major and minor device L4 CO3

b)
numbers of 287 and 101respectively with all permission for everyone
Analyze how the locking files is done in Unix system. Why advisory locksare safe. And L4 c03
also explain about the APl which is used to lockthe files
)Interpret how the mv command can be emulated using the link and unlink APL L4 CO3
Module 4
Ta) Evaluate the use of appropriate Unix utility and filter commands which will help to list the 8 L5 CO4
dates of all Sundays of October 2020.
b) Two club events 'Code Clash' and Code Freeze' were organized in the college. Students L5 CO4
rom vanious sections participated in the events, Evaluate how the appropriate Unix filter
commands can be used to list out only those students who attended both the events.
)Determine the usage of filter commands for the following operations 8 L5 CO4
i) To convert the contents of the tile foo.txt to uppercase
ii) To find out the number of directory files in the current directory.
ii) To find the number of files in the current directory
OR
8a) Evalunte the usage of extended regular expression with appropriate examples L5 CO4
b) Evaluate the advantages of vfork ) over fork() system call. 4 L5 CO4
Determine the ways of running jobs in the background and also to sehedule a mail to be 8 L5 Co4
sent every Sunday at 9 am to clubhouse.
Module 5
9a) Evalute the usage of awk built in functions with suitable examples
L5 CO5,
C06
b) Deduce logic to write a shell script program which will check if the group user has read and 7 L5 CO5,
write permission for a file accepted as command line argument. Display appropriate error
CO6
messages.
c)Determine the logic to write a shell script which will check if a given file is a symbolic link
L5 CO5,
file or hard linked file. Display appropriate messages. C06

OR
103) Evaluate the usage of awk built in variables with suitable examples. L5 CO5,
CO6

b) Cho0se an appropriate logic to write a shell script program which will accept a number n
7 L5
from the user and prints the square and cube of that number
3
c)Deduce logic to write a shell script which emulates the working ofa simple calculator to
L5 CO5,
perform simple arithmetic operations.
CO6

Page 2 of 2
USN 19CSE35

New Horizon College of Engineering, Bangalore


Autonomous College affiliated to VTU, Accredited by NAAC with 'A" Grade & NBA
Semester End Examinations March-2021
UNIX SYSTEM PROGRAMMING
Duration: 3 hrs Max. MarkS: 100
Answer five full questions choosing one complete question from each module.

Module 1
I a) Discuss the different POSIX versions available on the machine with the help of a C program. Coi
b) Explain the architecture of UNIX operating system by specifying the separate roles of the cOL
Kermet and the shell

OR
a) DEscuss the teatures of UNDX operating system. 10 L2 COI
b) Esplain the following parameters with the help of a POSIX complaint CC program, Number of L2 COI
clock ticks, Maximum number of child processes, Maximum path length, Maximum number
of characters in a file name and Maximum number of open files or
processes.
Module 2
3a) Solve the following dilemma of Alice with relevant examples where she wants to know L3 C02
t h e current working directory
i) display the encrypted passwords of users in the
system
C h a n g e the permission ot a fie atat to -rw-rwusing absloute permissions
d i s p l a y the inode number of a tie a.txt
change the modified time to October 2
b)lustrate with the help of example the output of ls-I emphasizing on each field. 10 L3 CO2
OR
4a) 1lustrate the creation of the following tree structure. A directory USP" created inside root L3 cO2
Inside which are 3 subdirectories "CSE, 1SE. "MECH. Subdirectory CSE' is divided into
A. "B and C. Creation of the above hierarchy has to be done using absolute pathname
'A" from
only. Navigate to subdirectory
and
rootcreated absoluteinpathname
using
b)
Deleteall the directories subdirectories
Given ls-li abe.tt the output is displayed as
by you a single step.
10 13 CO2
2221313-rw-rw-1becse 10 Oct02 10:30 foo.txt
Solve with the help of output and the inode number, the following scenarios
s-li foo
n to0.at fool.txt;
In-s foo.Ixt foo2.txt; Is -i
foo
Module S

Analyze any 5 functions defined for directory file functions defined in <dirent.h> or 10 L4 CO3
sys/dir.h> eaders
6 L4 CO3
Analyze the role of the operating system to enable the change of ownership for the user with
the help of chown APl by writing a C program which takes 2 arguments:user name.pathname
of file and emulates the working of chown system call.
L4 CO3
9Examine the role
offcntl API be used toset amandatory lock
can
permission at an offset of S12 to a length of 1024 bytes.
on a fle for read

Page 2 of 2
19CSE35

OR
6a) Devise a strategy to emulate the mv command using link and unlink APl L4 cO3
b) Analyze the working of FIFO files. Devise a C program that illustrates the use of mknod, 6 L4 CO3
open, read, write and close APls on a block device file
Interpret the role of acess mode flags along with acess modifier flags in the open API L4 cO3

Module 4
7a) Determine the usage of filter commands for the following operations 5 CO4
ito convert the words director in atxt to uppercase
ito find out the number of directory files in the current directory.
ii) to find the number of files in the curent directory
iv)To display following fields of a file: the type and pemission,link count of the file and the
owner ot the file.

b) Evaluate the working on commands difi, cmp, comm with respect to file comparison with LS co4
proper examples.
CO4
Evaluate the commands fork) and vforkO) with examples.
OR
a) Evaluate the different ways of running the jobs in the background CO4
b) There is a file called 'sample" which contains repeated information. Evaluate how the LS CO4
on the
intormation with proper examples.
oowing commands wok
)
sort-u of an audit every sunday at 10am.
A mail has to be sent to Mr.Haris to remind LS CO4
him
Evaluate how the cron command can be used for the same with proper explanation.
Module 5
9a) Interpret the usage of awk built in variables with suitable examples LS COS,
CO6
b) Evaluate the usage of BEGIN and END sections in awk. Devisea small awk program which LS CO5,
will compute the average marks in a file called student. txt with the fields as USN, Name CO6
And Marks, with the delimiter as " used in the file
shell script program to evaluate the while and wait using sieep 0 L5 CO5,
)Design
unction
a
working of CO6

OR
10a) Examine the usage of awk built in functions with suitable examples L5 CO5,
c06

b) Compare the various sources of list which can be used in a for loop in shell script. L5 cO5
c06

Justify how the awk command can be formulated which will enable us to count the number 7 L5 COs,
of managers present in a file called emp.lst which has the following fields in order CO6
EMP idem Name.Designation,Department,DateofJoin, Salary.The delimiter used in the file is

Page 2 of 2
19CSE35
New Horizon College of Engineering, Bangalore
Autonomous College affiliated to VTU, Accredited by NAAC with A' Girade & NBA

Supplementary Semester
End Examination October 2020
UNIX SYSTEM PROGRAMMING
Duration: 3 hrs Max. Marks: 100

Answer five full questions choosing one complete question from each module.

and purpose of sysconf,


Module 1
1a)ENplain
functions.the protory pe pathconfand fpathconf 6
CO
b). Explain the various versions of POSIX. Write a C program to display L2 CO
POSIX version.
Summarize the features of UNIX operating system. L2 COpi

R
2a) Explain the common characteristics of API along with erTOr status 6
codes and their
meaning
L2
co
b) Write a POSIX complaint C program to explain follow ing limits at 6
runtime:
L2
CO
i) No. of clock ticks (i) Max. no. of child processes
(ii) Max. path length (iv) Max. no. of characters in a file name ()

e)
Max. no. of open files/ process
Summarize on the division of labor concept adopted in the UNIX
architecture win a necar
L2
cO
dagran Module 2

3a)
b)
ldentify the fields when execute the command Is
different
Identify the purpose of following commands
we
L3
CO2
C02
i) tput ii )calender ii) who iv)uname vxty
) h e output obtained on executing the command s too.txt is as 8 L3 CO2
follows.
rw-rw- Charlie Charlie 80 Aug 10 10:30 a.txt
Apply your knowledge on file commands and list
which will update the output of lstoo.txt output as tolows.
out the commands
rwxrw-r-x 2 John Sam 80 Sep 25 11:30 a.bxt.
R
4 a) lustrate the different types of files in UNIX SYSTEM. L3 cO2

b) Identify the ile support provided by Kernel. L3 CO2

e)ldentify the differences between soft and hard links. Apply your L CO2
knowledge on soft and hard links to explain the output of the given
command
Given Is-i 1oo.txt
a
2221313-rw-rw-rI John John 10 Aug 25 10:30 foo.txt
fool.txt ls -li foo"
) ln foo.txt
i) n -s foo.txt foo2.txt; Is-li foo

Page
elots
19CSE35

Module 3
5a) Analyze the impotant uses of fcnti API. Give its prototype 10 L4 CO3
description. Examine how we can use the APl in a C program to

check
if it is whether
not
the close.on_exec lag is set for a given
set, toset
ile, foo and
this lag
D) Analyze the working of fork system call with examples. Write a C 6 L4 CO3
program to illustrate the purpose of fork system call.

the with their prototype


)Analyze
i) lseek
followingAPls
ii) access
L4 CO3

OR
6a) it
na certan application is requied to set a mandatory exclusive lock
on a tile, foo trom the position 50 to l00 from the starting of the file.
10 L4 CO3

it is has
Before setting the lock required check if any other process
to

ocKcd the ie. notset


the
the lock.
then
Write thethedata "Unix System
file.
Programming to file and unlock Analyze the
diferent APIS that can be used to write a C program to implement
this application.
b) Analyze the APls that can be used to perfom the following: 6 L4 CO3
the exists or not
) to check whether file /home/nhce/usp
it the file does not exists, create the file and write "Hello Worid"
) to

) Analyze the APls used for creating opening reading rewinding 4 L4 CO3
and closing directories
Module 4
7a) Detcrmine theUNIX kernel support for process considering parent 8 L5 cO4
child the
process. Choose related data structure required.
b) Assess different forms of exec system call. Explain their prototype 4 L5 c4
also their purpose.
el Mal the -i and and L5 CO4
the
command with options-v, -n,
usca
-c

wilh the
bove options on the
options on m p lst
the eemp.lst file
file w
whose cOntents are
gen
2233:Charles:Manager:
86 72Bill:Director:production
5678: Robert:Manager:marketing
1006:Michaeldirector:marketing
0110:Julie:DIRECTOR:sales
OR
8a) Evaluate the APls that can be used by a parent process to wait for the 8 L5 CO4
child process. Explain their prototype and provIde comparison.
b) Determine and evaluate the commands that can be used to perform 4 LS cO4
he following
Running jobs in the background

c)
)ENeCute Jobs later
Consider a tile named studentdetails.txt. The contents of the file are as 8 LS CO4
tollows with field I thcir USN.2
field their name.3 the department and
4 of
the their date birth and the 5 field their rank
233 Manjunatha| cse |12/129209
602 (GauraV gUp Og 61
678| sumit chakrobarty | ece|19/04.92 61
Page 2 of 3
19CSE35

563| burun sengupta jise |/o5/92) 788


Evaluate Using appropriate filter commands which does the following8
The number of characters in the first line
i)Display lines 2 and 3

)Replace the delimiter | with # and /with -

iv )searches for all names having gupta as


patern..
9 a) Examine the shell parameters S", S#, 50, S odule
nd $? in UNIX and interpret LS COS,
he values of these variables for the given command
CO6
S test unix shell programming.
b) Evaluate a shell program to accept the pattern and filename to LS CO5,
pertorm grep by accepting data as command line arguments CO6

c)Determine the purpose of the diflerent built in functions of awk L5 COs,


CO6

OR
10a) Examine the significance and importance of test statement in shell L5 CO5,
programming CO6
b) Evaluate a menu driven shell script perform the following tasks usin 7 L5
Case conditional statement COS,
CO6
i) list of users who are logged in
i) list of files in the current directory

i) list of processes of the user


iv) curent working directory
v)quit to UNIX
e)Determine the purpose of the different built- in variables in awk. L5 COs,
CO6

Page 3 of 3
19CSE35

New Horizon College of Engineering, Bangalore


Autonomous College afmliated ta VTI, Aceredited by VAAC with 'A" Grade & NBA

Makeup Examination Jan 2020

UNIX SYSTEM PROGRAMMING


Duration 3 hrs Max Vauks. 100
Answer five full questions ehoosing one complete question from each module
Module 1
I) Discuss the division of labor concept
on adopted in the 6 2
cO
UNIX architecture with a neat diagram.
b)Explainthe term feature test macros with any 5 example 2 cO

macros.
) S h o w the POSIX defined configuration options supported * 2 cOI

on any given system with the help of a POSIX Compliant


C program using feature test macros.
OR
2a)
Describe the features of UNIX operating system. 61.2 cO
b) the different codes present the L2
Explain error to signify cO
occurrence ofan error on UNIX.
Discuss sysconf, pathconf and fpathconf with syntax and 12 cO

examples.
Module 2
3a) lustrate different calegories of files and show how they 13 cO2
can be crealed and deleted with an example outpu.
bAssume the file fun.txt is created by cat command with L3 CO2
the content "This is an example text file " and its default

permission is rw -w - r - . Modify the file

permissions to rwx rw - rw .Write the output with


explanation
cApply the commands which will hclp you to S13 c02
i)Know the current working directory
ii)List all the attributes of the files from the curent
directory with inode number
Page 1 of4
19CSE35

ii) Modify the permission of a file sample.txt


file to
r -

r- using absolute assignment.


iv)Display the UID and GID ofa lile sample.txt using
number instead of names
v)Increase the hardlink count of sample.txt
vidisplay one line information of any command
vi)convert decimal 5 to binary
viin)ereate the symbolic link for the filc sample.txt
OR
49) llustrate how will you ensure that all regular files created 6L3 CO2

by users will have the default pemissions -rw-r Apply


your knowledge to identify the command to do this kind of
modification.
t Choose the command which will display all the attribuies 13 cO2

of a file named list.txt including the file inode number with


proper explanation of all atributes.
used 13 CO2
Apply your knowledge to identify the commands to

i) modify the file permission


ii) increase the hard link count and symbolic link count
ii) decrease the hard link and symbolic link count
iv) change the access time
Assume the name of a file as modify ixt and write the
output.
Module 3
S) Analyze the concept of locking the record or file. And 1 4 Co3

also explain the diffcrent locking mechanisms available


and specify which type of lock is safe and why it is safe.
L4 COJ
DAnalyze how the zombie process is created using example
program.
L4 CO3
Justify the command which will display unique names

from the file I and file 2 and common names from


both
the files. Assume each file contains 10 sorted names of
thestudents 2 of 4
19CSE35

OR 14 CO3
o) Justify the APl(with prototype and return value) which is
used to
i) Create the block device filc namcd /dev/bdsk with
major and minor device numbers of 287 and
10lrespectively with all permission for everyone
ii) Establish a connection between a proccss and a file
iii) Create a new regular files
iv) The cxistence and access permission of user to a
named file.
v) Deletes a link of an existing file 6 L4 C03
DAnalyze the fentl API for locking the record with the
explanation of struct flock lyped variablec L4 co3
Examine stat, fstat and Istat APls with their prototype and
return valuc.
Module 4
8
)How would you create the child process usinge program.
Justily your answer with proper explanation and output.
DChoose the command which will display he process L O
status along with system and user process. And also

specify the command which is uscd to run the jobs in the


background even after logging out the system.
LS cO4
Consider the following sampledatabase. How would you
100 Aswanth | cse |45000| 03
223 IMax cse |470001 03
150| kumar | ece |48000J 17
100 Adarsh | cse |65000] 09
i)Extract only the department
& sort in
ii)Extract the names, put it in separate file
reverse order
111 )scarchpattern cse
the with number of occurrTences.

iv)Replace the | with


OR
3 15 C04
command in c
)Tlow would you implement the system
Page 3 of 4
19CSE35

program with fork, Cxecl and waitpid APl's. Justify your


answer with explanation.
Consider the file word.txt is having one paragraph of text. 1 cO4

Choose the command which is used to count the number


of lines, words and character from word.txt.
How would the signal be handled by the process. And also* L5
co
specify how would you reduce the priority of job
execution by the unix command. What will happen if the
following command is issued
nice n 5 we -I hugefile.txt &
Module 5
9) Justify the significance L.5
of test and [ to evaluate an COs
CO6
expression in shell.
7
b) Evaluatethe different conditional statements available in 15COs CO6
shell.
Interpret all the awk built-in variables available in awk 7 15 Co
C06
with example program.
OR
6 1
10) Interpret all the awk built-in functions available in awk
COS
CO6
with example program.
7 L5 CO5,
Consider the following scenarios on a new terminal CO6
i) Good morning" message is displayed if the time is
12:00am to 11:59am
ii) "Good allernoon" message is displayed if the time is
12:00 pm to 3:59pmn
i) "Good evening" message is displayed if the time is
4pm onwards.
Justify the displaying of the above messages with the help
of a shell program
F v a l u a t e the squares o f a n y number entered by the user in 7 5 CU
COG
a shell program.

Page 4 of 4
US CSE35

New Horizon College of Engineering, Bangalore


Autonomous College affiliated to VTU, Accredited by NAAC with 'A* Grade & NBA

Make Up Examinations Jan 2019


UNIX & SHELL PROGRAMMING
Duration: 3 hrs Max. Marks: 100
Answer five full questions choosing one complete question from each module.
Module 1
1a) what is operating system? List any 5 important features of UNIX operating system. 6 L
co
b) Describe the login and logout process in a UNIX machine co1

c)Write the following commands with options for each


) calendar 1) cal lin) uname
8 L1 cO1

iv) stty OR
2 a) What s division of labor concept adopted in the UNIX architecture with a neat u co1
diagram.
b) Write UNIX command structure explaining the purpose of options and arguments co1

c) Write the syntax of following commands with options for each 8 LI cOL
) date ) lock i) script iv) pwd
Module 2
3 a) Explain along with a block diagram the three modes of vi and explain how you can C04
SwIch rrom one mode to another.

b Explain the search and replace function in vi editor with suitable examples. 6 L2 co2

with
)EXplain the UNIX commands in detail options used for performing the following
the cursor at row 12, column 25
8 L2 co2

clearing
i) knowingthe screen
your and placing
environment
the
in) finding out decimal equivalent of 1101001
the current date in the form
Display dd/mm/yyyy
the difference between internal and external commands with suitable
4 a)Summarize
exampies
6 2 co2

b)Summarize the following concepts in vi together with the commands used 6 2 COz

Insertion or text
Appending the text
ii) Replacing of text
c) Explain the purpose of following vi editor commands 2 cO2
3b li) Sw i) ^
iv) S v) x Sdd
vi) j vil) vii)odule
u
s a) ldentity the differences between hard link and symbolic link. Using Is command how 10 L3 co2
we can retrieve all soft links in t
b) Current permissions on a file named unix is given by the permission string r w-- w 6 L3 co2
r Identify the chmod symbolic and octal representations required for
the permissions to the updated string
changing
rr****

c)
11r wxrw X X
Identify the UNIX Commands required for 4 co2

running jobs in the background


Executing jobs later
Draw the UNIX ile tree structure. Use the diagram to illustrate the parent child 10 co2
5 a)
Page 1 of 2
CSE35

relationship in UNIX and also the importance and purpose of each of the directories.
b) lGiven th compute the co2

ermissions on a file and directory is created the


that in o
i)Identify the command that helps you find all the directories from /bin and
/usr/bin having permissions 777
) To copy all files stored in /home/NHCE with .C .Cpp and java extensions to
prog directory in current directory
4 L3 co2
c)Illustrate the process of job creation

7a)
Module 4
Examine the following commands with syntax and examples s L4co
c u t ) paste il) sort iv) u
b) Apply the UNIX commands to perform the following actions cO
) To change the case of first three lines of file "shortlist" from lower to upper cO4
) To count the number of characters in the first line of the file "shortlist"
C)Examine the grep command with the options-v, n , i and-C. Derive the output 4co
command is used with the above options on the emp.lst file
generated when grep
whose contents are given

2233:Charles:Manager: sales
9867:Bill:Director:production
5678:Robert:Manager:marketing
1006:Michael:director:marketing
0110:Julie:DIRECTOR:sales
OR
8 a) Examine the following commands with syntax and examples

b) N COmmands to perform the following actions L3 co3


Y file "test" cO4
) To replace words Unix to UNIX in a file"unixtest t t
all
i) To list down all the phone numbers without the their names and addresses from
flePhone.bxt which is a separated file that contains as the 1 field Name, :
field Address and 3 field Phone number
i o extract the names of the users from /etc/passwd

CExamine the concepts of line addressing and context addressing in sed with B L4 co3
co4
examples
Module 5
9 a) $1, and $? in
Analyze the shell parameters $, $#,
the command
$0, UNIX. Discuss the values of L4
cOs
these variables for given
S test unix shell programming.
D ) w r i t e a shell program that will do the following tasks in order with suitable 7 L4 Cos

ioar the screen


Drint the current directory
List of files in the current directory
Display the content of the file accepted as command line input
c)Analyze the string based built-in functions in awk L4
cos
10a Analyze the use of test and [] to evaluate an expression in shell cOs

bExaminethe signitficance of BEGIN and END section in an awk program with help of 7 L4 cos
an example cO6

c) Analyze all the built-in variables in awk 4 cOs

Page 2 of 2
ISE35/CSE35

New Horizon College of Engineering, Bangalore


Autonomous College affiliated to VTU, Accredited by NAAC with A" Grade& NBA
Semester End Examinations Nov/Dec 2018

UNIX & SHELL PROGRAMMING


Duration: 3 hrs Max. Marks: 100

Answer five full questions choosing one complete question from each module.

Module 1
1 a) Explain system calls and the role of system administrator in UNIX 10
co
machine
b) Analyze the division of labour between shell and kernel. COl

OR

2a) DiscusSs man documentation using suitable examples. 10 2 cOI

b) Analyze the features of UNDX Operating System which differentiates 10 14


CO
it from Windows Operating System
Module 2

3Discuss the different modes of vi editor. Explain with a neat diagram CO2

a) and list the commands in each mode.


b) Explain how the following is done: CO2

) to move 2 lines from the beginning of a fle to the end


i) to combine 5 lines into 1 line
c) Discuss the output of the following: 8 CO2

Repeating the last command li)changing case


i)exit to UNIX shelliv)undoing the last editing instructionss
R

Describe all the navigation commands used in vi editor. CO2

)
b) Dlscuss with examples deleting, yanking and changing of text. CO2

c)Explain the following commands with a sample output: 8 2 CO2

)tty i)who lii)bc iv)lock


Module 3

Determine the set of command used to move a file from 10 3 cO2


a) usr/spool/ip/admins to /usr/spool/mail and also the output of the
command cat foo foo foo where foo is the name of the file.

Page 1 of 2
ISE35/CSE35

b) Show how init process helps in creating login shell. 6 3 cO2

c) Illustrate the parent child relationship of UNIX file system. cO2

OR
6 Assuming that files current permission is r w - r - x r , solve the chmod 10 CO2
expression using both octal and symbolic method without using
required to change the permission of a file foo.txt to
rwxrwxrwx i) r- r i)---r-r

iv) rwxrw V)r-xr-xr-x


Show the output of the command touch foo. Change the 6 CO2
b)
modification time of this file to Sep 30, 10:30 a.m and the access

time to Oct 1, 10:30 a.m.


c) Identify the command to perform the following tasks cO2

)Job execution with low priority


i)Running jobs in background
Module
7a) Given a file,how the following command can be used cO3, cO4

)comm il)uniq il)pr iv) cut


b) Analyze the importance of grep command with options cO3, cO4

c)Interpret the following syntax and analyze the output cO3,,cO4

1) grep A\*" and explain the necessity of \


) grep a bc

OR

Given a file ,what will be the output of the following commands 8 L4 CO3, cO4

a) i)tr i)nl ii)od iv) head


b) Distinguish the use of egrep and fgrep to take patterns from a file. L4 cO3, CO4

c)Compare the different addressing mechanism used in sed. L4 CO3,,cO4


Module 5
COs
9a) Display the processes in the system five times every 30 seconds
using a i. while loop ii. for loop
0 LS CO6
b) Write a program that uses built in variables available in AWK,
OR
COs
10a) Using a shell script display the last three lines of each file in the
current directory, preceded by its file name.
b)Write a program that uses built in functions availlable in AWK. CO6

Page 2 of 2

You might also like