Unix Interview Questions And Answers
- Candidates who are going to appear in Unix Interview should check the Unix Interview Questions And Answers. These question and answer are for both Fresher’s and Experienced candidates.
- You should prepare for your interview with the help of these. You may download it free in the PDF form from the below section of this page, which is structured by the team of recruitmentresult.com.
1) What is UNIX?
It is a portable operating system that is designed for both efficient multi-tasking and mult-user functions. Its portability allows it to run on different hardware platforms. It was written is C and lets user do processing and control under a shell.
2) Predict the output of the following program code
fork(); fork(); fork();
Answer: “Hello World” will be printed 8 times.
3) What are the key features of the Korn Shell?
- history mechanism with built-in editor that simulates emacs or vi
- built-in integer arithmetic
- string manipulation capabilities
- command aliasing
- job control
4) What are some common shells and what are their indicators?
- sh – Bourne shell
- csh – C SHell
- bash – Bourne Again Shell
- tcsh – enhanced C Shell
- zsh – Z SHell
- ksh – Korn Shell
5) What is a directory?
Every file is assigned to a directory. A directory is a specialized form of file that maintains a list of all files in it.
6) Briefly describe the Shell’s responsibilities
- program execution
- variable and file name substitution
- I/O redirection
- pipeline hookup
- environment control
- interpreted programming language
7) What is piping?
Piping, represented by the pipe character “|”, is used to combine two or more commands together. The output of the first command serves as input the next command, and so on.
8) Predict the output of the following program code.
Answer: Hello World!Hello World!
9) Is it possible to see information about a process while it is being executed?
Every process is uniquely identified by a process identifier. It is possible to view details and status concerning a process by using the ps command.
10) Write a command that will display files in the current directory, in a colored, long format.
Answer: ls -l –color
11) Write a command that will find all text files in a directory such that it does not contain the word “amazing” in any form (that is, it must include the words Amazing, AMAZING, or aMAZINg)
Answer:1 grep –vi amazing *.txt
12) Write a command that will output the sorted contents of a file named IN.TXT and place the output in another file named OUT.TXT, while at the same time excluding duplicate entries.
Answer: 1 sort IN.TXT | uniq > OUT.TXT
13) What command will change your prompt to MYPROMPT: ?
Answer: To change a prompt, we use the PS1 command, such as this:
1 PS1 = ‘MYPROMPT:’
14) What does this command do? cat food 1 > kitty
Answer: it redirects the output of cat food into the file kitty; the command is the same as: cat food > kitty
15) Write a shell script that requests the user’s age and then echoes it, along with some suitable comment.
- cho Hello! What\’s your age\?
- read age
- echo $age! I\’ll be obsolete by that age!
16) Write a script that prints out date information in this order: time, day of week, day number, month, year (sample output: 17:34:51 PDT Sun 12 Feb 2012)
- set ‘date’
- echo $4 $5 $1 $3 $2 $6
Something That You Should Put An Eye On
|How to Write a Good Resume||Personality Improvement Tips|
|Interview Questions and Answers||Group Discussion: Dos and Don’ts|
|Common Interview Mistakes||Phone Interview Tips|
|How To Dress For An Interview||Why Should We Hire You?|