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.

Which command is used for killing a line?(a) ctrl-k(b) del(c) esc(d) ctrl-uThis question was addressed to me in class test.This key question is from General Purpose Commands in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct answer is (d) ctrl-u

The explanation is: If the command line CONTAINS too many mistakes, we could prefer to kill the line altogether without EXECUTING it using ctrl-u. It ERASES EVERYTHING in the line and returns the cursor to the beginning of the line.

2.

Which control unlocks the keyboard?(a) ctrl-u(b) ctrl-c(c) ctrl-z(d) ctrl-qThe question was posed to me during an interview.This question is from General Purpose Commands in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct choice is (d) ctrl-q

Easiest explanation: ctrl-q RESUMES the scrolling of screen output and UNLOCKS the KEYBOARD. Ctrl-h is used to erase character by character when BACKSPACE doesn’t work while and Ctrl-c interrupts the program and bring back the prompt.

3.

Ctrl-S stops scrolling of screen output and ________(a) locks terminal(b) delete a character(c) locks keyboard(d) delete a lineI have been asked this question in an interview for job.Asked question is from General Purpose Commands topic in chapter The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct choice is (c) locks keyboard

To explain: There are various keyboard COMMANDS to try when THINGS go wrong. One of these commands is Ctrl-s which STOPS scrolling of SCREEN OUTPUT and locks the keyboard.

4.

When backspace doesn’t work to erase characters, we can use _____(a) ctrl-f(b) ctrl-h(c) ctrl-c(d) ctrl-uThe question was posed to me in homework.This is a very interesting question from General Purpose Commands topic in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct choice is (b) ctrl-H

Easiest explanation: Sometimes it may happen that BACKSPACE doesn’t work and whenever it is pressed, ^H is displayed on the terminal. To RESOLVE this problem, we can USE control key i.e. ctrl-H. Ctrl-u is used for killing a line altogether without executing it and Ctrl-c interrupts the program and bring back the prompt.

5.

For interrupting a command, we can use _____(a) ctrl-f(b) esc(c) ctrl-h(d) ctrl-cThis question was addressed to me in exam.My query is from General Purpose Commands in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

Right answer is (d) ctrl-c

The explanation is: Sometimes, a program goes on running on for an HOUR and does not seem to complete. To interrupt that command we can use the CONTROL KEY, ctrl-c. Ctrl-h is used to ERASE CHARACTER by character when backspace doesn’t work.

6.

Which command handles a character stream by duplicating its input?(a) tree(b) tee(c) tty(d) lsThe question was asked in an interview for job.This interesting question is from General Purpose Commands topic in section The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct answer is (b) tee

Easy explanation: tee is an EXTERNAL command which handles a STREAM of CHARACTERS by duplicating its input. It saves one COPY in a file and writes the other to standard output. tee command can be placed anywhere in a pipeline.

7.

We can use man command for displaying the documentation of man itself.(a) True(b) FalseThe question was posed to me during an interview for a job.The query is from General Purpose Commands topic in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct option is (a) True

The EXPLANATION: Since MAN is also a UNIX command, it is NECESSARY to know how man itself is used. For this purpose, use the same command to VIEW its own documentation:

8.

Which command is used by the user to change their login password in UNIX?(a) man(b) reset(c) passwd(d) cpThis question was posed to me in an interview for job.Question is taken from General Purpose Commands topic in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

Right answer is (c) passwd

For explanation I would say: Since UNIX is a multiuser system, it requires a PASSWORD from every user who wants to log in to the system to help ensure that all the data and files of the user are secure from HACKERS and ERRANT users. A user can simply change his/her login password by using the passwd COMMAND. Simply type this command on the terminal and then enter the old password, which after successful verification would allow the user to input a new password for his login.

9.

-h option is used with who command for what purpose?(a) display output with header information(b) display output with a more detailed version(c) display output with trailer information(d) display output in columnar formThe question was asked during an online interview.My question comes from General Purpose Commands in section The Unix Architecture & General Purpose Utilities of Unix

Answer»

Right option is (a) display output with HEADER INFORMATION

Easy explanation: While most UNIX commands have a feature to AVOID cluttering the display with display information, who command does have a header option( -H ). This option prints the COLUMN headers ALSO.

10.

history command displays the log of recently used commands.(a) True(b) FalseThis question was addressed to me during an interview.The query is from General Purpose Commands in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct answer is (a) True

For explanation: History command displays the list of RECENTLY USED commands by the user which means WHATEVER commands are used by the user in the current session will be displayed on the terminal using history command.

11.

Two or more users can have same login name in the output of who command.(a) True(b) FalseI have been asked this question in examination.The origin of the question is General Purpose Commands topic in chapter The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct OPTION is (a) True

Best explanation: Yes, UNIX PROVIDES us a feature that two users can login with the same USERNAME at the same TIME on the same network host.

12.

Which of the following is not an internal command used by mailx?(a) N(b) d(c) q(d) aThe question was posed to me in exam.I'm obligated to ask this question of General Purpose Commands topic in chapter The Unix Architecture & General Purpose Utilities of Unix

Answer» RIGHT choice is (d) a

Easy EXPLANATION: There are various INTERNAL COMMANDS used by mailx each of which performs a specified task.
13.

Which of the following function cannot be performed by mailx command?(a) sending and receiving emails(b) reply to the sender(c) forward, delete and print mails(d) un-send mailsI have been asked this question in an interview for internship.This question is from General Purpose Commands in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

Right choice is (d) un-send mails

For explanation I WOULD say: mailx command can perform VARIOUS functions apart from SENDING and receiving emails such as replying to the sender and all recipients, forward it to OTHERS, save it to a different folder, delete it, print it. To view received emails, simply type mailx command and hit ENTER.

14.

script command is used for___________(a) recording history(b) recording our session(c) recording passwords(d) recording scriptsThis question was addressed to me in a national level competition.Origin of the question is General Purpose Commands topic in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct answer is (B) RECORDING our session

To explain I would say: script COMMAND is basically used for recording our login session in a file. All the keystrokes, output, ERROR messages that are encountered while our session will be stored in a file which we can view LATER. The name of the file in which the session is stored is typescript.

15.

mailx command is used for sending and receiving emails.(a) True(b) FalseI have been asked this question in exam.This key question is from General Purpose Commands topic in section The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct ANSWER is (a) True

Explanation: Since UNIX is a multiuser system, so communication between systems seems to be natural and important. For this purpose MAILX command is used. Through mailx command, we can SEND and receive emails to different users on same host network or different network. The addressing scheme USES a combination of username and machine name. For example,

16.

For what purpose bc command is used?(a) as a calculator(b) as an editor(c) as a process table viewer(d) for copying filesI got this question in an interview for internship.My query is from General Purpose Commands in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct choice is (a) as a calculator

Easy explanation: BC command is used for invoking calculator on UNIX SYSTEM. It comes with a WIDE library for performing CALCULATIONS. The power of this tool can be derived from the fact, that it can PERFORM calculations up to and above 900 digits!

17.

Which of the following is a valid option with script command?(a) -b(b) -a(c) -d(d) -xThe question was posed to me in class test.I want to ask this question from General Purpose Commands in chapter The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct answer is (b) -a

To elaborate: SCRIPT command OVERWRITES any previous typescript that may EXIST. -a option allows us to append our session to the existing typescript file without overwriting to it.

 For EXAMPLE,script-a

 We can also record our session to a different log file by USING the following command.

18.

Which command is used as an alternative to echo command?(a) ls(b) printf(c) wc(d) psThe question was posed to me in an online quiz.My query is from General Purpose Commands in chapter The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct choice is (b) printf

The explanation is: printf command is AVAILABLE on most UNIX systems and it behaves MUCH like a SUBSTITUTION for echo command. It SUPPORTS many of the formats which are used by C’s printf function. printf is also an EXTERNAL command.

19.

What are escape sequences?(a) special characters beginning with a \ (backslash)(b) special commands(c) special utilities(d) a sequence of charactersThe question was asked during an interview.I want to ask this question from General Purpose Commands in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct answer is (a) special characters beginning with a \ (backslash)

Explanation: An escape sequence is generally a TWO character string which begins with a \. The role of escape sequences is that they change the state of COMPUTER or the peripheral DEVICES attached to it, For example, \n is an escape sequence which IMPLIES a new LINE character.

20.

Which command is used for displaying date in the format dd/mm/yyyy ?(a) date+%m(b) date +%h(c) date+”%d/%m/%Y”(d) date +”%h %m”The question was posed to me by my school principal while I was bunking the class.This interesting question is from Commands topic in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct option is (C) date+”%d/%m/%Y”

Explanation: Date COMMAND can use format SPECIFIERS as arguments with each specifiers PRECEDING with a + , followed by % operator and a single CHARACTER for describing the format.

21.

echo command is used for _________(a) displaying errors(b) displaying operating system details(c) displaying diagnostic messages(d) displaying date and timeI have been asked this question in examination.My enquiry is from General Purpose Commands topic in section The Unix Architecture & General Purpose Utilities of Unix

Answer»

Right answer is (c) displaying diagnostic messages

Easy explanation: ECHO command is generally used for displaying diagnostic messages on to the terminal or to ISSUE prompt for READING the user input. All shells now have echo built in i.e. it is an internal command.

22.

What are meta-characters?(a) special characters having predefined meaning to the shell(b) special symbols(c) shell symbols(d) command symbolsThis question was posed to me in an internship interview.This key question is from Commands topic in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

Right choice is (a) special characters having predefined meaning to the shell

To EXPLAIN: meta-characters are special characters having a predefined meaning to the shell. They are used as wild CARDS for special purposes like PATTERN matching, OUTPUT redirecting etc. *, |, < are meta-characters.

23.

What is the output of who command?(a) display information about users who are currently logged in.(b) display file hierarchy(c) display administrator information(d) display processesI have been asked this question by my school teacher while I was bunking the class.I would like to ask this question from Commands in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

The CORRECT answer is (a) display information about users who are currently logged in.

To explain: who command OUTPUT the DETAILS of the users who are currently logged in to the system. The output includes username, terminal name (on which they are logged in), date and TIME of their LOGIN etc.

24.

Which command is used for displaying date and calendar in UNIX?(a) date and cal(b) DATE and CAL(c) date and calendar(d) dt and clI had been asked this question during an interview.I'd like to ask this question from Commands topic in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct answer is (a) date and cal

Best explanation: date command is USED for DISPLAYING the CURRENT system date and time while cal command is used to see the calendar of any specific month/year.

25.

Which command is used to display the documentation of commands in UNIX?(a) help(b) search(c) whatis(d) manI got this question in an interview.This interesting question is from Commands in section The Unix Architecture & General Purpose Utilities of Unix

Answer»

Right choice is (d) man

The explanation is: UNIX provides US with a facility of man command, which is used for getting documentation of any command. For example, to SEEK help on wc command simply type man wc. This will simply display all the possible operations, options, description, synopsis of wc command. The POSIX specification requires only one available option with man command i.e.-k, which prints a one-line description of the command. whatis command is ALSO available on many UNIX systems which also DISPLAYS a one-line description of the command. man -F emulates the behavior of whatis command.

26.

How can we specify more than one command in the command line at the same time?(a) using ;(b) using >(c) using ==(d) not possibleThis question was addressed to me during an internship interview.My doubt is from Commands in section The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct option is (a) using ;

The BEST I can explain: UNIX allows us to specify more than one command at the same TIME in the command line. To do so, we have to separate each command from each other using (;). For EXAMPLE, WC file1 ;ls-l file1 . The > symbol allows us to redirects the output of the command(s). For example, wc file1 > file2. Now, file2 will CONTAIN the output produced by the wc file1 command. Both ; and > are called metacharacters.

27.

Which of the following is not a valid option of uname?(a) -a(b) -s(c) -v(d) -zThis question was addressed to me in an interview for job.This intriguing question originated from Commands topic in division The Unix Architecture & General Purpose Utilities of Unix

Answer» CORRECT choice is (d) -z

Easiest EXPLANATION: UNAME command is used for PRINTING the information about the current system.-a is used for printing all the information including version NAME, kernel name, kernel release, machine hardware name etc. -s is used for printing only the kernel name while -v is used for printing the kernel version.
28.

Options are also arguments but begin with a -.(a) True(b) FalseThe question was posed to me during an interview for a job.My query is from Commands in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

Right option is (a) True

The best EXPLANATION: Arguments are parameters which are specified ALONG with commands so that the command can perform an operation or take input from that parameter while options are also arguments but they are predetermined i.e. they perform a particular task. For EXAMPLE, echo hello. In this command hello is an argument while in ls– l, -l is an option.

29.

The sequences of directories that a shell searches while looking for a command is specified in the PATH variable.(a) True(b) FalseThis question was posed to me by my college professor while I was bunking the class.Query is from Commands topic in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct CHOICE is (a) True

For EXPLANATION: When we specify a command, the SHELL searches for that command in the list of directories specified in the PATH VARIABLE and then executes it after locating the command successfully.

30.

Which command is used for extracting the details of the operating system?(a) cd(b) echo(c) uname(d) wcThe question was posed to me during an interview.This intriguing question originated from Commands topic in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct option is (C) uname

Explanation: uname command is used for extracting the details LIKE name, version of the operating system running on the machine. the cd command is used for CHANGING directories and echo command is used for displaying the contents of a string on to the OUTPUT STREAM. wc command is used for counting words and other details in a file.

31.

What are Commands?(a) specific instructions for performing a particular task(b) part of the operating system(c) part of the shell(d) special instructionsI got this question in a national level competition.Enquiry is from Commands topic in portion The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct option is (a) specific instructions for performing a PARTICULAR task

Explanation: COMMANDS are basically specific instructions which are given by the users to perform a particular piece of a task. In UNIX, commands are entered by the USER through a command line interface which further is PROCESSED by the command interpreter i.e. Shell.

32.

In how many categories, commands of UNIX operating system classified?(a) 1(b) 2(c) Many(d) 0This question was addressed to me in an online quiz.The question is from Commands in chapter The Unix Architecture & General Purpose Utilities of Unix

Answer» CORRECT answer is (b) 2

Easiest EXPLANATION: There are two broad categories in which the classification of commands is based on UNIX. They are namely—external commands and internal commands. External commands are those commands that have an independent EXISTENCE in the /bin directory i.e. these are the EXECUTABLES which are present in separate files while Internal commands are BUILT-in commands which are built into the shell. Example, ‘ls’ is an external command while ‘echo’ is an internal command.
33.

What is the windowing system of UNIX known as?(a) X Window system(b) LINUX(c) Red Hat(d) DOSI have been asked this question by my college professor while I was bunking the class.Question is from Introduction to UNIX topic in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct option is (a) X WINDOW system

The explanation: The X window system, COMMONLY known as X, is a WINDOWING system developed at MIT. It is an open-source, network TRANSPARENT, client-server based system that PROVIDES a Graphical user interface. X is primarily used on UNIX variants but it is also available for other operating systems also.

34.

Two UNIX systems may or may not use the same set of system calls.(a) True(b) FalseI have been asked this question in exam.Query is from Introduction to UNIX topic in section The Unix Architecture & General Purpose Utilities of Unix

Answer» CORRECT CHOICE is (b) False

For explanation I would SAY: All UNIX flavors have one thing in common, they use the same SYSTEM calls which are described in POSIX specification.
35.

What is a superuser?(a) system manager(b) normal user(c) administrator(d) a user with special rightsThe question was asked during an online exam.My doubt is from Introduction to UNIX in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

Right CHOICE is (a) system manager

Best explanation: A superuser (root) is the UNIX system manager which can PERFORM special tasks like killing any executing program, resetting other users PASSWORDS, change users permissions and performing other system management tasks. The administrator can switch to superuser by ISSUING su command.

36.

Which part of the UNIX operating system interacts with the hardware?(a) Kernel(b) Shell(c) vi editor(d) application programThis question was posed to me in an online interview.Question is taken from Introduction to UNIX topic in section The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct CHOICE is (a) Kernel

For EXPLANATION I would SAY: The kernel is the core of the operating system. It is a collection of routines written in C which directly communicates with the hardware. User programs that need to interact with the hardware ACCESS the services of the kernel. There is only ONE kernel running on a system, unlike shells which can be multiple.

37.

Shell is a command interpreter used for interacting with a UNIX system.(a) True(b) FalseThe question was asked in an online interview.This key question is from Introduction to UNIX in chapter The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct OPTION is (a) True

Easy EXPLANATION: COMPUTERS don’t have any capability of translating commands into actions. To do so we REQUIRE shell-a command interpreter which translates our commands into actions. It is actually the interface between the user and kernel. There could be MULTIPLE shells in action on a single system.

38.

POSIX is a set of standards specified for establishing compatibility between operating systems.(a) True(b) FalseI got this question in an online quiz.Asked question is from Introduction to UNIX topic in section The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct choice is (a) True

To EXPLAIN I would say: POSIX- Portable OPERATING System Interface for Computer Environment is basically a set of standards SPECIFIED by IEEE for establishing compatibility between operating systems, especially which are UNIX based. For example, if we write a program relying on POSIX standards, we can EASILY port it AMONG a large family of Unix derivatives (including Linux).

39.

Which of the following is not true about UNIX?(a) Many people can use a UNIX based computer at the same time; hence UNIX is called as a multiuser system(b) A user can run multiple programs at the same time; hence UNIX is called a multitasking environment(c) UNIX was not written in ‘C’ language(d) Linux is also known as a version of UNIXThe question was posed to me during an interview.The doubt is from Introduction to UNIX in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct CHOICE is (c) UNIX was not written in ‘C’ language

Easy explanation: One of the most attractive features of UNIX is that it supports multi-user and multitasking ENVIRONMENT which makes it so popular among its users. There are many UNIX variants available in the market. Solaris Unix, AIX, HP Unix, BSD are some of the EXAMPLES. Linux is also a flavor of UNIX which is freely available. Unix was developed in 1969 by AT&T employees Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna at BELL Labs and was written in ‘C’.

40.

Which of the following is not a part of all the versions of UNIX?(a) Kernel and Shell(b) Commands and utilities(c) Graphical user interface(d) System CallsI got this question by my college professor while I was bunking the class.I'd like to ask this question from Introduction to UNIX topic in division The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct choice is (c) GRAPHICAL user interface

The best EXPLANATION: The kernel is the HEART of the operating system while the SHELL is the utility which processes our requests. While system calls are a handful of functions which are used to interact with the kernel and make available the services provided by the operating system. A Graphical user interface (GUI) is available in UNIX, but the traditional UNIX interface is the command LINE only.

41.

In which language UNIX is written?(a) JAVA(b) Python(c) C++(d) CI got this question by my school teacher while I was bunking the class.Query is from Introduction to UNIX topic in section The Unix Architecture & General Purpose Utilities of Unix

Answer»

Correct answer is (d) C

For explanation I would SAY: UNIX was originally WRITTEN in Assembly language but Dennis Ritchie and Ken THOMPSON wanted an operating system which could run on more than one type of hardware. So in 1973, they rewrote the whole operating system in C language due to which one of the strongest features i.e. PORTABILITY was added to the operating system.

42.

Which of the following is not a feature of UNIX?(a) multitasking(b) multiuser(c) portability(d) easy to useI had been asked this question in unit test.I want to ask this question from Introduction to UNIX topic in chapter The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct answer is (d) EASY to use

Best EXPLANATION: UNIX is a multitasking operating system i.e. a USER can run multiple tasks concurrently. Similarly, it is a MULTIUSER system because it permits working with multiple users on a single operating system. But a major disadvantage of UNIX lies in the fact that the richness provided by its commands requires a SPECIAL type of commitment to understand the subject. i.e. the user must be well aware of commands he is using and the functions performed by them.

43.

What is UNIX?(a) an operating system(b) a text editor(c) programming language(d) software programI have been asked this question at a job interview.This interesting question is from Introduction to UNIX in chapter The Unix Architecture & General Purpose Utilities of Unix

Answer»

The correct option is (a) an operating system

For explanation I would say: UNIX is an operating system developed in the early 1970’s at Bell LABS by Dennis Ritchie, Ken Thompson, and others. It is a MULTIUSER, multitasking and timesharing operating system. The power of UNIX is DERIVED from its commands and their MULTIPLE options.