JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III Year LINUX PROGRAMMING Previous Question Paper (October - 2020 - R13)

B.Tech | III Year | I Semester | R13 | October - 2020

Answer PaperPaper Code: 115EDMaximum Marks: 75Time: 2 hours

Answer any five questions

All questions carry equal marks

Main

1

List various Linux commands used for process utilities and disk utilities with examples.

15 marks

Answer

Linux provides a suite of utilities for managing processes and disk resources. Below are the primary commands for each category.

Process Utilities

  1. ps: Displays information about active processes. Example: ps aux shows all running processes for all users.
  2. top: Provides a dynamic, real-time view of the system's running processes and resource usage.
  3. kill: Sends a signal to a process to terminate it. Example: kill -9 1234 forces the process with PID 1234 to terminate.
  4. nice/renice: Adjusts the scheduling priority of a process. Example: nice -n 10 ./script.sh runs a script with a lower priority.
  5. pgrep/pkill: Searches for or terminates processes based on name or other attributes. Example: pgrep firefox returns the PID of the Firefox process.

Disk Utilities

  1. df: Reports file system disk space usage. Example: df -h displays disk usage in a human-readable format (GB/MB).
  2. du: Estimates file space usage for directories and files. Example: du -sh /home/user summarizes the total size of the user directory.
  3. fdisk: A menu-driven command-line utility for disk partition manipulation. Example: fdisk -l lists all available partitions on the system.
  4. mount/umount: Attaches or detaches a file system to the directory tree. Example: mount /dev/sdb1 /mnt/data mounts a partition to a specific directory.
  5. fsck: Used to check and optionally repair file system inconsistencies. Example: fsck /dev/sda1 checks the integrity of the specified partition.
2

Explore about Unix file permission commands and file ownership.

15 marks

Answer

In the Unix file system, every file and directory is associated with an owner and a group, and access is controlled through permissions defined for three categories: the owner (u), the group (g), and others (o). Permissions are categorized into read (r), write (w), and execute (x).

File Ownership Commands:

  • chown: Used to change the owner of a file or directory. The syntax is
    chown [owner] [file]
    . Only the superuser can change the owner of a file.
  • chgrp: Used to change the group ownership of a file or directory. The syntax is
    chgrp [group] [file]
    .

File Permission Commands:

  • chmod: Used to change the access permissions of a file. It supports two modes:
    • Symbolic Mode: Uses operators like + (add), - (remove), and = (set). For example,
      chmod u+x filename
      adds execute permission for the owner.
    • Absolute (Octal) Mode: Uses three-digit numbers where 4 represents read, 2 represents write, and 1 represents execute. For example,
      chmod 755 filename
      sets read, write, and execute for the owner (4+2+1=7), and read and execute for the group and others (4+0+1=5).
  • umask: Sets the default permissions for newly created files. It acts as a bitwise mask subtracted from the default system permissions (usually 666 for files and 777 for directories).

The ls -l command is used to view these attributes, displaying a string like

-rwxr-xr--
, where the first character indicates the file type, followed by three sets of rwx triplets for the owner, group, and others respectively.

3

Write short notes on the following.

15 marks
a

Unix kernel support for the process

7 marks

Answer

Sign in to view the complete answer paper.

b

System call interfaces for process management.

8 marks

Answer

Sign in to view the complete answer paper.

4

Briefly describe about IPC between related processes versus IPC between unrelated processes.

15 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

What is meant by Unix system shared memory and state the Unix kernel support for shared memory.

8 marks

Answer

Sign in to view the complete answer paper.

b

State about shmget, shmat, shmdt and shmctrl API’s.

7 marks

Answer

Sign in to view the complete answer paper.

6

State the procedure for handling input and output of the Linux programs with suitable commands.

15 marks

Answer

Sign in to view the complete answer paper.

7

Draw and explain about directory structure in Unix and describe the commands opendir, closedir, readdir, rewinddir.

15 marks

Answer

Sign in to view the complete answer paper.

8

What is Unix signal system API and construct a sample code for signal mask and signal action.

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 Year I Semester, October - 2020, R13.

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...