Unix Interview Questions and Answers
Question - 61 : - Explain ‘nohup’ in UNIX?
Answer - 61 : - “nohup” is a special command that is available to run a process in the background. The process starts with ‘nohup’ command and does not terminate even the user started to log off from the system.
Question - 62 : - On which mode, the fault handler executes?
Answer - 62 : - At the Kernel mode.
Question - 63 : - What is the purpose of the “echo” command?
Answer - 63 : - “echo” command is similar to the “ls” command and it displays all the files in the current directory.
Question - 64 : - Describe the concept “Region”?
Answer - 64 : - Continuous area of processes address space (text, data, and stack) is identified as a region. Regions are shareable among the processes.
Question - 65 : - What is meant by user area (u-area, u-block)?
Answer - 65 : - The area is only manipulated by the kernel and it contains the private data. This is unique to the process and each process is allocated to u-area.
Question - 66 : - What is called piping?
Answer - 66 : - “piping” is used to combine two or more commands together. The output of the first command work as the input of the second command, and so on. Pipe character ( | ) is represented as piping.
Question - 67 : - Explain the term filter.
Answer - 67 : -
A filter is described as a program, which takes input from the standard input, and displays results to the standard output by performing some actions on it.
Standard input could be text typed on the keyboard, input from other files or output of other files serving as input. Standard output is by default the display screen.
The most popular example of Unix filter id is grep command. This program look for a certain pattern in a file or list of files and only those lines are displayed on the output screen which contains the given pattern.
Syntax: $grep pattern file(s)
Some of the options that are used along with grep command are enlisted below:
-v: prints line that does not match the pattern.
-n: print matched line and line number.
-l: print file names with matching lines.
-c: prints only count the matching lines.
-i: matches either uppercase or lowercase.
Question - 68 : - Write a command to erase all files in the current directory including all its subdirectories.
Answer - 68 : -
“rm –r*” is the command used to erase all files in the current directory including all its subdirectories.
- rm: This command is used for deleting files.
- -r: This option will erase all files in directories and sub-directories.
- ‘*’: This represents all entries.
Question - 69 : - What do understand by Kernel?
Answer - 69 : -
Unix operating system is basically divided into three parts, namely, the kernel, the shell, and the commands and utilities. Kernel serves as the heart of the Unix operating system which does not deal directly with the user but rather acts as a separate interactive program for users logged in.
It performs the following functions:
- Interacts with the hardware
- Perform tasks like memory management, file management, and task scheduling.
- Control computer resources
- Helps to allot resources to different tasks and users.
Question - 70 : - Describe key features of the Bourne shell.
Answer - 70 : -
Bourne shell is referred to as the standard shell. The default prompt here is ‘$’ character.
The key features of the Bourne shell include:
- Input/ Output redirection.
- Use of Metacharacters for file name abbreviations.
- Using shell variables for the customizing environment.
- Creation of programs using built-in the command set.