Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

How to stop an infinite loop in Unix?

Answer»

To STOP an infinite loop, kill the PROCESS USING the ‘kill PID’ command.

Example – $ kill -9 24566

2.

How zip the file in Unix?

Answer»

You can USE the ZIP command to zip files in Unix.

Example – zip math.zip file1 FILE2 FILE3

3.

What is Unix orphan process?

Answer»

A process, whose parent process terminates, FINISHES or crashes and doesn’t EXIST anymore is called orphan process. They are adopted by the init SYSTEM process.

4.

What is Hardlink and Softlink in Unix?

Answer»
S.noHARDLINKSOFTLINK
1.Additional name for the same existing file. Hardlink acts as a SHORTCUT to the file that has been hardlinked.A file that points to ANOTHER file through a pointer. There is no data in the target file.
2.Preserves the contents of a file.If the target file is deleted, softlink is RENDERED USELESS.
5.

How to check logs in Unix?

Answer»

You can CHECK LOGS in the FILE SYSLOG LOCATED in /etc/syslog.conf

6.

What command is used to switching between users in Unix?

Answer»

Use the ‘su’ COMMAND to switch between USERS in Unix.

Syntax – su [options] [USERNAME]

7.

How to find the path in Unix?

Answer»

To FIND the PATH, USE the COMMANDECHO $PATH

8.

What are pipes and filters in Unix?

Answer»
  • Pipes – a pipe connects small commands together to execute a COMPLETE complex task. Pipe symbol is ‘|.’ The flow of data through the pipe is from left to right. Example – $ cat names.txt | grep “Sam” | TEE sam.txt | wc -1
  • Filter – FILTERS are used to MODIFY the output of a command. Examples of filters are grep, sort, more, less, cat, cut and so on.
9.

What are system variables in Unix?

Answer»

Some system variables SET in Unix by default are HOME, USER, HOST, DISPLAY, and PATH. These can be environment variables or local variables ENABLED by the shell.

10.

What is the difference between an absolute path and a relative path in Unix?

Answer»
S.noABSOLUTE PATHRELATIVE PATH
1.the full path starting at the root directory (/).Path in relation to the present working directory as the reference.
2.Example - /home/math/tutorialAccess the current directory using the COMMANDPWD’. CHANGE the directory using ‘cd’.
11.

What are a shell in Unix and its types?

Answer»

SHELL is a program that gives us an interface between the Unix OS kernel and user. By this interfacing, the user can execute utilities and applications USING the shell. Each user gets a unique shell when he logs in or opens a console. The DIFFERENT shells are Bourne shell (sh), C shell (csh), the Korn shell (ksh), GNU Bourne-Again Shell (bash).

12.

How do you kill a process in Unix?

Answer»

Use the command kill ALONG with the process id (PID) to kill a process.

Example – kill 12323

If this does not destroy the process, ADD the signal number for a kill to kill the process. Unix cannot IGNORE the signal number.

Example – kill -9 12323

Continue reading Unix interview questions to know how you can stop an infinite loop USING the same command

13.

How to find out what processes are running in the background in Unix?

Answer»

Type the command jobs to SEE the processes RUNNING in the background.

Example

Example – $ jobs give the output as –

[134]+ Running SLEEP 50 &

where 134 is the job number.

14.

What is the command to compare two files in UNIX?

Answer»

You can USE the following COMMANDS to compare two files –

  • cmp [OPTIONS] file1 file2 – compare 2 files character by character
  • comm [options] file1 file2 – compare SORTED files
  • diff [options] file1 file2 – compare two files line by line
15.

How to compare two text files in UNIX?

Answer»
16.

What are different types of files in UNIX?

Answer»

The different types of UNIX files are –

  • ordinary files – text, data or program instructions.
  • directories – stores regular and special files.
  • special files – device files, used for INPUT and output operations.
  • pipes – temporary FILE that holds intermittent data until the second LAST command.
  • sockets ALLOWS advanced COMMUNICATION between several processes.
  • symbolic links (soft links) – contains the path to another file (reference file)
17.

What are the essential features of the Unix operating system?

Answer»
  • It is a multi-user, multitasking system
  • Uses kernel and SHELL to execute commands and complete tasks
  • Hierarchical file system
  • EASILY portable to other machines as the code can be easily changed and compiled.
  • Has pipes and filters to DIVIDE COMPLEX tasks into smaller utilities and then combine them.
  • Application code is independent of the HARDWARE vendor.

Continue reading our Unix interview questions list to know more about each of these features.

18.

How is Unix different from Linux?

Answer»

Linux can be said as a clone of UNIX with the following differences –

S.noUNIXLINUX
1.UNIX does not have a free version.Linux is open source and freely distributed.
2.Requires more wait time for an issue to be FIXED properlyCommunity-based; hence solutions are faster.
3.It is mainly used for web servers, PCs and workstations.Can be installed on any device, tablet, mobile, PC, etc.
4.Source code is not availableOpen source, code is available for everyone.
5.Different versions are AIS, BSD etc…Different versions are REDHAT, SOLARIS, Ubuntu etc…
19.

How to install Unix on Windows 10?

Answer»

Unix can be installed on Windows 10 USING VirtualBox, an open source virtualization tool.

  • Download VirtualBox (HTTPS://www.virtualbox.org/wiki/Downloads) and CREATE a virtual machine. Select memory and virtual hard disk requirements.
  • Download the ISO image file from a reliable source.
  • Install the distribution in the VirtualBox in seamless mode.

Alternatively, you can install Unix in dual boot.

20.

What is the role of the kernel in Unix?

Answer»

The kernel is the CENTRAL control of Unix. Kernel is the first part to be loaded when the OS LOADS and remains THROUGHOUT the session. It executes processes, manages MEMORY and handles INTERRUPTS and system calls. It provides drivers for controlling the hardware.

21.

What is a filter in Unix? Give an example.

Answer»

The filter is a program that gets its data from the input STREAM and prints the RESULTS to the output stream. Examples – grep, sort, TAIL, head, cut, etc.…

22.

What is Unix and why is it important?

Answer»

Unix is an operating system that supports multitasking and multi-user capabilities. Unix provides a simple and user-friendly interface for users. It is the FIRST OS to be WRITTEN in high-level (C) programming language.

Unix is important:-
  • Firstly, because of its design attributes from the initial release itself. That is, each complex task is divided into small, modular UTILITIES that are easy to do.
  • Secondly, during the initial internet boom, most web SERVERS were UNIX machines from IBM, Sun, ETC., hence making it a standard system for web servers.
23.

17. What are the common directory management commands in Unix?

Answer»
  • CD – change directory
  • pwd – current directory
  • mkdir – create a NEW directory
  • rmdir REMOVE an EMPTY directory
24.

What are the file permissions and access modes in Unix?

Answer»

There are THREE TYPES of permissions – owner, group and other (public), all of which can be listed using the command ls -l. Each USER can have one or more of the following access – read (r), write (w), execute (X). Example, -rwxr-xr-- represent the file permissions for owner, members and everyone else as –

  • Characters 2-4 (rwx) – means the owner has read, write and execute permission,
  • Characters 5-7 (r-x) – indicates that the group has read and EXECUTED permission,
  • Characters 8-10 (r--) – indicates that everyone else has only read permissions.