Unix Interview Questions And Answers

Unix Interview Questions list for experienced

  1. What is UNIX?
  2. What is a UNIX Shell?
  3. Explain the steps that a UNIX shell follows while processing a command.
  4. What difference between cmp and diff commands in UNIX?
  5. What is the use of 'grep' command in UNIX?
  6. What is the difference between cat and more command in UNIX?
  7. Write a command to kill the last background job?
  8. Which command is used to delete all files in the current directory and all its sub-directories?
  9. Name the data structure used to maintain file identification?
  10. How many prompts are available in a UNIX system?
  11. How we will find which operating system your system is running on in UNIX?
  12. . How will we run a process in background? How will we bring that into foreground and how will you kill that process?
  13. How do we know if a remote host is alive or not?
  14. How do we see command line history in UNIX?
  15. . How do we copy file from one host to other?
  16. How do we find which process is taking how much CPU?
  17. How do we check how much space left in current drive ?
  18. What is the difference between Swapping and Paging?
  19. What is difference between ps -ef and ps -auxwww?
  20. How do we find how many cpu are in our system and there details?
  21. . What is Zombie process in UNIX? How do you find Zombie process in UNIX?
  22. In a file word UNIX is appearing many times? How will we count number?
  23. How do we set environment variable which will be accessible form sub shell?
  24. How do we find whether your system is 32 bit or 64 bit ?
  25. How do we find which processes are using a particular file?
  26. How do we find which remote hosts are connecting to our host on a particular port say 10123?
  27. What is ephemeral port in UNIX?
  28. If one process is inserting data into our MySQL database? How will we check how many rows inserted into every second?
  29. There is a file Unix_Test.txt which contains words Unix, how will we replace all Unix to UNIX?
  30. we have a tab separated file which contains Name, Address and Phone Number, list down all Phone Number without there name and Addresses?
  31. our application home directory is full? How will we find which directory is taking how much space?
  32. How do we find for how many days your Server is up?
  33. Write a script that will show the following as output: Give me a U! U! Give ma a N! N! Give me a I! I! Give me a X! X!
  34. 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)
  35. Write a shell script that requests the user's age and then echoes it, along with some suitable comment.
  36. What is wrong with this interactive shell script? echo What month is this? read $month echo $month is as good a month as any.
  37. What does this command do? cat food 1 > kitty
  38. Write a command that will allow a UNIX system to shut down in 15 minutes, after which it will perform a reboot.
  39. 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.
  40. 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)
  41. Write a command that will display files in the current directory, in a colored, long format.
  42. What would be the effect of changing the value of PATH to: .:/usr/della/bin: /bin: /usr/bin
  43. How do we switch from any user type to a super user type?
  44. What is the output of this command? $who | sort –logfile > newfile
  45. What is wild-card interpretation?
  46. How does the system know where one command ends and another begins?
  47. What is pid?
  48. What is parsing?
  49. Differentiate cat command from more command.
  50. What is the use of the tee command?
  51. Why is it that it is not advisable to use root as the default login?

Unix interview questions and answers on advance and basic Unix with example so this page for both freshers and experienced condidate. Fill the form below we will send the all interview questions on Unix also add your Questions if any you have to ask and for apply in Unix Tutorials and Training course just send a mail on info@pcds.co.in in detail about your self.

Top Unix interview questions and answers for freshers and experienced

What is Unix ?

Answer :

Questions : 1 :: What is UNIX?

UNIX  is a multitasking, multi-user computer operating system. The UNIX operating system comprises three parts: The kernel, the standard utility programs, and the system...View answers

Questions : 2 :: What is a UNIX Shell?

The shell is a type of program called an interpreter. An interpreter operates in a simple loop: It accepts a command, interprets the command, executes the command, and then waits for another...View answers

Questions : 3 :: Explain the steps that a UNIX shell follows while processing a command.


After the command line is terminated by the key, the shell goes ahead with processing the command line in one or more passes. The sequence is well defined and assumes the following order. Parsing:...View answers

Questions : 4 :: What difference between cmp and diff commands in UNIX?

cmp – Compares two files byte by byte and displays the first mismatch diff – tells the changes to be made to make the files identical

Questions : 5 :: What is the use of 'grep' command in UNIX?

‘grep’ is a pattern search command. It searches for the pattern, specified in the command line with appropriate option, in a file(s). Syntax : grep Example : grep 99mx mcafile

Questions : 6 :: What is the difference between cat and more command in UNIX?


Cat displays file contents. If the file is large the contents scroll off the screen before we view it. So command ‘more’ is like a pager which displays the contents page by page.

Questions : 7 :: Write a command to kill the last background job?

 Kill $!

Questions : 8 :: Which command is used to delete all files in the current directory and all its sub-directories?

rm –r

Questions : 9 :: Name the data structure used to maintain file identification?


‘inode’, each file has a separate inode and a unique inode number.

Questions : 10 :: How many prompts are available in a UNIX system?

Two prompts, PS1 (Primary Prompt), PS2 (Secondary Prompt).

Questions : 11 :: How we will find which operating system your system is running on in UNIX?

By using command "uname -a" in UNIX  

Questions : 12 :: . How will we run a process in background? How will we bring that into foreground and how will you kill that process?

For running a process in background use "&" in command line. For bringing it back in foreground use command "fg jobid" and for getting job id we use command "jobs", for killing that process...View answers

Questions : 13 :: How do we know if a remote host is alive or not?

  we can check these by using either ping or telnet command in UNIX. This question is most asked in various Unix command Interview because its most basic networking test anybody wants to do...View answers

Questions : 14 :: How do we see command line history in UNIX?

  Very useful indeed, use history command along withgrep command in unix to find any relevant command we have already executed. Purpose of this Unix Command Interview Questions is probably...View answers

Questions : 15 :: . How do we copy file from one host to other?

  Many options but we can say by using "scp" command. we can also use rsync command to answer this UNIX interview question or even sftp would be...View answers

Questions : 16 :: How do we find which process is taking how much CPU?

  By using "top" command in UNIX, there could be multiple follow-up UNIX command interview questions based upon response of this because “TOP” command has various interactive...View answers

Questions : 17 :: How do we check how much space left in current drive ?

By using "df" command in UNIX. For example "df -h ." will list how full our current drive is. This is part of anyone day to day activity so we think this Unix Interview question will be to check...View answers

Questions : 18 :: What is the difference between Swapping and Paging?

  Swapping: Whole process is moved from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation...View answers

Questions : 19 :: What is difference between ps -ef and ps -auxwww?

This is indeed a good Unix Interview Command Question and we have faced this issue while ago where one culprit process was not visible by execute ps –ef command and we are wondering which...View answers

Questions : 20 :: How do we find how many cpu are in our system and there details?

  By looking into file /etc/cpuinfo for example ywe can use below command: cat /proc/cpuinfo

Questions : 21 :: . What is Zombie process in UNIX? How do you find Zombie process in UNIX?

When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it - for example, the parent may need to...View answers

Questions : 22 :: In a file word UNIX is appearing many times? How will we count number?

  grep -c "Unix" filename

Questions : 23 :: How do we set environment variable which will be accessible form sub shell?

  By using export   for example export count=1 will be available on all sub shell.

Questions : 24 :: How do we find whether your system is 32 bit or 64 bit ?

  Either by using "uname -a" command or by using "arch" command.

Questions : 25 :: How do we find which processes are using a particular file?

  By using lsofcommand in UNIX. It wills list down PID of all the process which is using a particular file.

Questions : 26 :: How do we find which remote hosts are connecting to our host on a particular port say 10123?

. By using netstat command execute netstat -a | grep "port" and it will list the entire host which is connected to this host on port 10123.

Questions : 27 :: What is ephemeral port in UNIX?

  Ephemeral ports are port used by Operating system for client sockets. There is a specific range on which OS can open any port specified by ephemeral port...View answers

Questions : 28 :: If one process is inserting data into our MySQL database? How will we check how many rows inserted into every second?

  Purpose of this Unix Command Interview is asking about "watch" command in UNIX which is repeatedly execute command provided with specified...View answers

Questions : 29 :: There is a file Unix_Test.txt which contains words Unix, how will we replace all Unix to UNIX?

  You can answer this Unix Command Interview question by using SED command in UNIX for example we can execute sed s/Unix/UNIX/g fileName.

Questions : 30 :: we have a tab separated file which contains Name, Address and Phone Number, list down all Phone Number without there name and Addresses?

  To answer this Unix Command Interview question we can either use AWK or CUT command here. CUT use tab as default separator so we can use cut -f3...View answers

Questions : 31 :: our application home directory is full? How will we find which directory is taking how much space?

  By using disk usage (DU) command in Unix for example du –sh . | grep G  will list down all the directory which has GIGS in Size.

Questions : 32 :: How do we find for how many days your Server is up?

  By using uptime command in UNIX

Questions : 33 :: Write a script that will show the following as output: Give me a U! U! Give ma a N! N! Give me a I! I! Give me a X! X!

  for i in U N I X do MS DOS echo Give me a $i! echo $i! done 1 2 3 echo Give me a $i! echo...View answers

Questions : 34 :: 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)

1 ..set‘date’ 2 .echo $4 $5 $1 $3 $2...View answers

Questions : 35 :: Write a shell script that requests the user's age and then echoes it, along with some suitable comment.

  1.echo Hello! What’s your age? 2.readage 3.echo $age! I’ll be obsolete by that...View answers

Questions : 36 :: What is wrong with this interactive shell script? echo What month is this? read $month echo $month is as good a month as any.

Initially, the question mark should be escaped (?) so that it is not interpreted as a shell metacharacter. Second, it should be read month, not read $month.

Questions : 37 :: What does this command do? cat food 1 > kitty

it redirects the output of cat food into the file kitty; the command is the same as: cat food > kitty

Questions : 38 :: Write a command that will allow a UNIX system to shut down in 15 minutes, after which it will perform a reboot.

/sbin/shutdown–r+15

Questions : 39 :: 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.

Questions : 40 :: 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)

grep–viamazing*.txt

Questions : 41 :: Write a command that will display files in the current directory, in a colored, long format.

ls -l –color

Questions : 42 :: What would be the effect of changing the value of PATH to: .:/usr/della/bin: /bin: /usr/bin

This would cause the shell to look in the /usr/della/bin directory after looking in the current directory and before looking in the /bin directory when searching for a command file.

Questions : 43 :: How do we switch from any user type to a super user type?

In order to switch from any user type to a superuser, ywe use the su command. However, we will be asked to key in the correct superuser password before full access privileges are granted to yus

Questions : 44 :: What is the output of this command? $who | sort –logfile > newfile

In this command, the output from the command “who” becomes the input to the “sort” command. At the same time, “sort” opens logfile, arranges it together with the...View answers

Questions : 45 :: What is wild-card interpretation?

When a command line contains wild-card characters such as ‘*’ or ‘?’, these are replaced by the shell with a sorted list of files whose pattern matches the input command....View answers

Questions : 46 :: How does the system know where one command ends and another begins?

Normally, the newline character, which is generated by the ENTER or RETURN key, acts as the signpost. However, the semicolon and the ampersand characters can also serve as command terminators.

Questions : 47 :: What is pid?

Pid is short for Process ID. It is used primarily to identify every process that runs on the UNIX system, whether it runs on the foreground or runs at the background. Every pid is considered...View answers

Questions : 48 :: What is parsing?

Parsing is the process of breaking up of a command line into words. This is made possible by using delimiters and spaces. In the event that tabs or multiple spaces are part of the command, these are...View answers

Questions : 49 :: Differentiate cat command from more command.

When using the cat command to display file contents, large data that does not fit on the screen would scroll off without pausing, therefore making it difficult to view. On the other hand, using the...View answers

Questions : 50 :: What is the use of the tee command?

  The tee command does two things: one is to get data from the standard input and send it to standard output; the second is that it redirects a copy of that input data into a file that was...View answers

Questions : 51 :: Why is it that it is not advisable to use root as the default login?

  The root account is very important, and with abusive usage, can easily lead to system damage. That’s because safeguards that normally apply to user accounts are not applicable to the...View answers
More Question

Ask your interview questions on Unix

Write Your comment or Questions if you want the answers on Unix from Unix Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---