JNTU
JNTU B.Tech III LINUX PROGRAMMING Previous Question Paper (September - 2021 - R15)
Answer any five questions. All questions carry equal marks.
Main
What is command substitution? What is the token used with command substitution?
Answer
Command substitution is a feature in the Linux shell that allows the output of a command to be replaced in the command line. When a command is enclosed in specific tokens, the shell executes the command first, captures its standard output, and replaces the expression with that output before executing the surrounding command.
The tokens used for command substitution are:
- Backticks (`): The traditional syntax, e.g., `date`.
- $() syntax: The modern and preferred syntax, e.g., $(date). This method is preferred because it is easier to nest and improves readability.
Write a shell script to illustrate ‘cat’ command in Linux.
Answer
The cat (concatenate) command is used to display the contents of files, create new files, or append data to existing files. The following shell script demonstrates these functionalities:
#!/bin/bash
# Script to demonstrate cat command
# 1. Display file content
echo "Displaying file content:"
cat file.txt
# 2. Create a new file using cat
echo "Creating newfile.txt..."
cat > newfile.txt <> newfile.txt <Explain about file ownership function.
Answer
Sign in to view the complete answer paper.
Explain briefly about text processing and process utilities.
Answer
Sign in to view the complete answer paper.
Describe the file system structure and different file types in Linux system.
Answer
Sign in to view the complete answer paper.
Explain about functions for scanning directories with syntax and examples.
Answer
Sign in to view the complete answer paper.
Describe hard links and soft links with examples.
Answer
Sign in to view the complete answer paper.
Explain the following: i) mkdir ii) rmdir iii) chdir
Answer
Sign in to view the complete answer paper.
Explain the following with example:
Process Creation
Answer
Sign in to view the complete answer paper.
Process Termination
Answer
Sign in to view the complete answer paper.
Signal function.
Answer
Sign in to view the complete answer paper.
Differentiate between fork( ) and vfork( ).
Answer
Sign in to view the complete answer paper.
Illustrate SIGKILL and SIGINT with an example program.
Answer
Sign in to view the complete answer paper.
Explain the kernel data structure for Message queue with a neat diagram. Also explain the APIs associated for message queue with an example program.
Answer
Sign in to view the complete answer paper.
Explain how to attach and detach a shared-memory segment.
Answer
Sign in to view the complete answer paper.
Explain how TCP connections are established and terminated.
Answer
Sign in to view the complete answer paper.