The document provides solutions to very short answer questions for a Linux and Shell Programming exam for B.Tech CSE students. It covers key concepts such as the structure of UNIX, boot and super blocks, the vi editor, commands like head, tail, split, kill, and comm, as well as scripting in Python, Telnet, and IPC. Each question is answered concisely with definitions, examples, and syntax where applicable.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
5 views3 pages
Linux Shell Programming Exam Answers (3)
The document provides solutions to very short answer questions for a Linux and Shell Programming exam for B.Tech CSE students. It covers key concepts such as the structure of UNIX, boot and super blocks, the vi editor, commands like head, tail, split, kill, and comm, as well as scripting in Python, Telnet, and IPC. Each question is answered concisely with definitions, examples, and syntax where applicable.
Q1. Describe in the structure of UNIX. Ans: The structure of UNIX consists of three main components: 1. Kernel – core of the OS, handles memory, CPU, device, and process management. 2. Shell – command interpreter that allows users to interact with the kernel. 3. File System – manages data in a hierarchical structure with files and directories. Example: When you type a command in terminal, shell interprets it and kernel executes it.
Q2. Define boot block and super block.
Ans: • Boot Block: It contains the bootstrap loader which loads the OS into memory. • Super Block: Contains metadata of the file system like size, block count, free blocks, and inode information.
Q3. Define the vi editor.
Ans: 'vi' is a screen-oriented text editor in UNIX. It operates in three modes: 1. Command Mode – default mode to run commands 2. Insert Mode – used for inserting text (press 'i') 3. Last-line Mode – used for saving and quitting (use ':' commands like :wq)
Q4. Discuss the head and tail command.
Ans: • head: Displays the first 10 lines of a file by default. Syntax: head filename.txt Example: head -n 5 file.txt → Shows first 5 lines.
Ans: The split command is used to split a file into smaller files. Syntax: split [options] filename prefix Example: split -l 5 data.txt part → Splits data.txt into files of 5 lines each like partaa, partab...
Q6. Describe the kill and com tab command.
Ans: • kill: Used to terminate processes manually. Syntax: kill [PID] Example: kill 1234 • comm: Compares two sorted files line by line. Syntax: comm file1 file2
Q7. Define the shell.
Ans: A shell is a command-line interpreter that provides a user interface to access the kernel's services. Examples: Bash, Zsh, Korn, C Shell.
Q8. Explain the scripting in Python.
Ans: Scripting in Python refers to writing small programs to automate tasks. Example: ```python print('Hello, Linux') ``` Used for automation, file handling, system administration, etc.
Q9. Discuss the Telnet.
Ans: Telnet is a network protocol used to access remote computers. Command: telnet hostname/IP It allows you to log into another machine remotely.
Q10. Define the IPC.
Ans: IPC (Inter-Process Communication) is used for data sharing between processes. Methods: Pipes, Shared Memory, Message Queues, Sockets.