Unix/Linux Interview Questions and Answers

What is relative path and absolute path?
Absolute path : Exact path from root directory. Relative path : Relative to the current path.
How to count number char, line in a file?
by using wc-stands for word count. wc -c for counting number of characters in a file. wc -l for counting lines in a file.
What is du command do?

With the help of this command you can find the disk capacity and free space of the disk.

What is the use of the command 'ls -x chapter[1-5]'?
ls stands for list; so it displays the list of the files that starts with 'chapter' with suffix '1' to '5', chapter1, chapter2, and so on.
What will the following command do? $ echo *
t is similar to 'ls' command and displays all the files in the current directory.
Which command is used to delete all files in the current directory and all its sub-directories?
rm -r *

What is the use of "grep" command?
"grep" is a pattern search command. It searches for the pattern, specified in the command line with appropriate option, in a file(s). Example : grep 99mx mcafile
What is a pipe and give an example?
Unix commands alone are powerful, but when you combine them together, you can accomplish complex tasks with ease. The way you combine Unix commands is through using pipes and filters. The symbol | is the Unix pipe symbol that is used on the command line. What it means is that the standard output of the command to the left of the pipe gets sent as standard input of the command to the right of the pipe. However, the pipe is different because it is used to pass the output of a command to another command- example: $ cat apple.txt | wc
What is the difference between cat and more command?
"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.

Latest Updates

Fill in the blank

I ________ station before the train arrived.

If I ______ a king, I would help everyone.

Radha___________her daughter for an hour.

Errors Identification

Find out which part of the sentence below has an error and mark the option accourdingly -
Sohan was married in 1990 and have three children.

Find out which part of the sentence below has an error and mark the option accourdingly -
There is no money in the bank in Ram Singh's and Rama's joint account.


Swapnil start from his home and walked 35 km towards east, after that he turned to his right and walked 20 km. He again turned to his right and walks 35 km. Finally, he turned to his left and walked 20 km and reached his office. How far is his office from his home?


How many 2 digit numbers are divisible by 6?


Find the smallest square number which is exactly divisible by 3, 5, 15, 18, 20 and 24?

HCF and LCM of two numbers are 82 and 574 respectively. if one of the numbers is 287, find the second number?


How many numbers between 1200 to 1500 are multiple of 13?

Find the total number of terms in the series : -3, 1, 5, 9,............., 101 ?

Find the sum of the first 20 terms of the series : 8, -3, 11, -6, 14, -12, 17, -24,....... ?


Find the missing term in the given series - 101, 120, 145, 168, (?), 224

Find the missing term in the given series - 11A13, 17E19, (?), 31O37, 41U43

Find the missing term in the given series - 2,4,8,3,9,27,4,16,(?),5,25,125


Which gas is fixed by Rhizobium bacteria present in the root nodules of a pea plant ?


The formation of sulphurous acid involves ?

The acid present in soft drinks is ?