JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA 2020 LINUX PROGRAMMING Previous Question Paper (October/ November - 2020 - R15)
Answer any five questions. All questions carry equal marks.
Main
Write a shell script to find the largest of 10 integers.
Answer
The following shell script reads 10 integers from the user and determines the largest value using a loop and a comparison condition:
#!/bin/bash
echo "Enter 10 integers:"
read max
for i in {2..10}
do
read num
if [ $num -gt $max ]
then
max=$num
fi
done
echo "The largest integer is: $max"Explain various process utilities in Linux with clear syntax.
Answer
Process utilities in Linux are used to monitor, manage, and control active processes. Key utilities include:
- ps: Displays information about currently running processes. Syntax: ps [options]Common options include -e (all processes) and -f (full-format listing).
- top: Provides a dynamic, real-time view of running system processes, showing CPU and memory usage. Syntax: top
- kill: Sends a signal to a process, typically to terminate it. Syntax: kill [-signal] [PID]
- nice: Starts a process with a modified scheduling priority. Syntax: nice -n [priority] [command]
- renice: Alters the scheduling priority of an already running process. Syntax: renice [priority] -p [PID]
- pgrep: Searches for processes based on name or other attributes and returns their PIDs. Syntax: pgrep [pattern]
Write about the following UNIX commands with example: cal, date, echo, printf, bc, script, mailx, who, tty, stty.
Answer
Sign in to view the complete answer paper.
How to declare and implement associative arrays? Give an example.
Answer
Sign in to view the complete answer paper.
Describe usage of dup( ) and dup2( ) system calls with example.
Answer
Sign in to view the complete answer paper.
Explain about symlink( ) function with example program.
Answer
Sign in to view the complete answer paper.
Write the syntax of the following system calls and explain with an example code:
a) telldir( ) b) mkdir( )
Answer
Sign in to view the complete answer paper.
Differentiate between fork( ) and vfork( ).
Answer
Sign in to view the complete answer paper.
What is the need of exec( ) system call? Write a C program to illustrate exec( ).
Answer
Sign in to view the complete answer paper.
Define Signals. What do you mean by Unreliable Signals? Explain.
Answer
Sign in to view the complete answer paper.
Describe SIGKILL and SIGINT with examples.
Answer
Sign in to view the complete answer paper.
Write a program and explain how to transfer a large amount of data between two processes using Message queues.
Answer
Sign in to view the complete answer paper.
Explain briefly about the following socket APIs with clear syntax:
a) accept( ) b) connect( ) c) bind( )
Answer
Sign in to view the complete answer paper.