JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III LINUX PROGRAMMING Previous Question Paper (March - 2021 - R15)

B.Tech | III | I | R15 | March - 2021

Answer PaperPaper Code: 125ED/115EDMaximum Marks: 75Time: 3 hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Give the differences between cmp, diff and comm utilities.

7 marks

Answer

These utilities are used for file comparison but serve different purposes:

  • cmp: Performs a byte-by-byte comparison of two files. It is the fastest way to check if files are identical. It outputs the byte and line number where the first difference occurs and exits silently if the files are identical.
  • diff: Performs a line-by-line comparison. It provides a detailed list of instructions (add, change, delete) required to transform one file into the other. It is primarily used for generating patches or viewing textual differences.
  • comm: Compares two sorted files line-by-line and produces a three-column output: lines unique to the first file, lines unique to the second file, and lines common to both. It requires the input files to be pre-sorted.
b

Describe the contents of a directory, explaining the mechanism by which its entries are updated by cp, mv, and rm commands.

8 marks

Answer

A directory in Linux is a special file that contains a list of mappings between filenames and their corresponding inode numbers. Each entry in this list consists of the filename and the inode index, which links to the actual file metadata and data blocks on the disk.

The cp, mv, and rm commands update these directory entries as follows:

  • cp: Creates a new entry in the destination directory with a new inode number. It allocates new data blocks and copies the contents of the source file into them.
  • mv: If moving within the same filesystem, it simply renames the entry by updating the directory list (changing the filename associated with the existing inode). If moving across filesystems, it behaves like a cp followed by an rm.
  • rm: Removes the filename entry from the directory list and decrements the link count of the associated inode. If the link count reaches zero, the system marks the inode and its associated data blocks as free for future use.
215 marks
a

What are the types of errors encountered in scripting? Give the causes and debugging options available in identifying and rectifying them.

8 marks

Answer

Sign in to view the complete answer paper.

b

Give the syntax of while and until structures in Bash Shell and illustrate them with an example.

7 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Discuss the relative merits and demerits of fcntl() system call.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain various status flags and file modes associated with an open() and create() system calls.

8 marks

Answer

Sign in to view the complete answer paper.

4

Explain about the scanning direction function.

15 marks

Answer

Sign in to view the complete answer paper.

5

What is job control? Explain the features of wait() and waitpid() system calls.

15 marks

Answer

Sign in to view the complete answer paper.

6

Describe the need and usage of the following system calls:

15 marks
a

fork()

5 marks

Answer

Sign in to view the complete answer paper.

b

kill()

5 marks

Answer

Sign in to view the complete answer paper.

c

signal()

5 marks

Answer

Sign in to view the complete answer paper.

7

Explain the classical producer consumer problem of operating system using semaphores in Linux.

15 marks

Answer

Sign in to view the complete answer paper.

8

Describe the functionality provided by system V IPC shared memory mechanism and discuss various kernel APIs associated with it.

15 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of LINUX PROGRAMMING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech IT III I, March - 2021, R15.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in LINUX PROGRAMMING

Loading Question Papers

Fetching data from database...