JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III Year LINUX PROGRAMMING Previous Question Paper (October - 2020 - R13)
Answer any five questions
All questions carry equal marks
Main
List various Linux commands used for process utilities and disk utilities with examples.
Answer
Linux provides a suite of utilities for managing processes and disk resources. Below are the primary commands for each category.
Process Utilities
- ps: Displays information about active processes. Example:
ps auxshows all running processes for all users. - top: Provides a dynamic, real-time view of the system's running processes and resource usage.
- kill: Sends a signal to a process to terminate it. Example:
kill -9 1234forces the process with PID 1234 to terminate. - nice/renice: Adjusts the scheduling priority of a process. Example:
nice -n 10 ./script.shruns a script with a lower priority. - pgrep/pkill: Searches for or terminates processes based on name or other attributes. Example:
pgrep firefoxreturns the PID of the Firefox process.
Disk Utilities
- df: Reports file system disk space usage. Example:
df -hdisplays disk usage in a human-readable format (GB/MB). - du: Estimates file space usage for directories and files. Example:
du -sh /home/usersummarizes the total size of the user directory. - fdisk: A menu-driven command-line utility for disk partition manipulation. Example:
fdisk -llists all available partitions on the system. - mount/umount: Attaches or detaches a file system to the directory tree. Example:
mount /dev/sdb1 /mnt/datamounts a partition to a specific directory. - fsck: Used to check and optionally repair file system inconsistencies. Example:
fsck /dev/sda1checks the integrity of the specified partition.
Explore about Unix file permission commands and file ownership.
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 filenameadds 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 filenamesets read, write, and execute for the owner (4+2+1=7), and read and execute for the group and others (4+0+1=5).
- Symbolic Mode: Uses operators like + (add), - (remove), and = (set). For example,
- 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
Write short notes on the following.
Unix kernel support for the process
Answer
Sign in to view the complete answer paper.
System call interfaces for process management.
Answer
Sign in to view the complete answer paper.
Briefly describe about IPC between related processes versus IPC between unrelated processes.
Answer
Sign in to view the complete answer paper.
What is meant by Unix system shared memory and state the Unix kernel support for shared memory.
Answer
Sign in to view the complete answer paper.
State about shmget, shmat, shmdt and shmctrl API’s.
Answer
Sign in to view the complete answer paper.
State the procedure for handling input and output of the Linux programs with suitable commands.
Answer
Sign in to view the complete answer paper.
Draw and explain about directory structure in Unix and describe the commands opendir, closedir, readdir, rewinddir.
Answer
Sign in to view the complete answer paper.
What is Unix signal system API and construct a sample code for signal mask and signal action.
Answer
Sign in to view the complete answer paper.