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

General Knowledge of India

In 1897, the Birsa Movement supporters raised which colour flag as a symbol of Birsa Raj?

Ratio and Proportion

The cost of 10 books is Rs. 80/-. Find the value of 15 books?

The cost of 48 bags of paddy is Rs. 16,800/-. What is the cost of 36 bags of paddy?

Monthly expenditure of a family of 4 members is Rs 2800/-. What is the expenditure if there are 3 members in the family?

Annual incomes of the families of Sita and Latha are in the ratio 4:3 and their annual expenditure are in the ratio 3:2. What is their annual income if they save Rs. 3000/- in a year?

A certain sum of money is divided between A and B in the ratio of 5/4 : 5/3 and A got Rs. 360/-. Find the total sum of money and B’s share?

In an office, the ratio of the salaries of an officer and a clerk is 15:7. If the salary of a clerk is Rs. 720/- less than the salary of the officer, find the salary of each?

In an election to a municipal council, the votes secured by two candidates are in the ratio 13:19. The elected candidates gets 312 votes more than the second candidate. How many votes are secured by the second candidate?

A certain sum of money is divided between Murthy and Prasad in the ratio 22/7 : 8/3. If Murthy gets Rs. 120/- more than Prasad, find the share of each?

In a cricket test series, the runs made by Raju and Tendulkar are in the ratio 5:9 and Tendulkar and Azar are in the ratio 6:7. What are the runs made by them if Azar makes 187 runs more than Raju?

If A:B = 2:3 and B:C = 9:5 find A:B:C?

If A:B = 3/5:5/7 and B:C = 3/4:2/5, find A:B:C?

If R:S = 0.01:0.11 and S:T = 2.2:1, Find R:S:T?

In a school, Under a Saving Scheme, Rekha saves 3/2 times the savings of Bindu, Geeta saves 4 times the savings of Rekha. Find the ratio of the savings of all the three in least terms?


A man left 1/3 rd of his property to his wife and 3/5 th of the remainder to his daughter. He gave the rest to his son who received Rs. 6400/-. How much was his original property worth?

Ratio and Proportion

In a school 4/9 of the pupils are boys. There are 125 girls. How many boys are there?

If A:B = 3:4 and B:C = 5:6, find A:C?

IF X:Y = 3:4 AND Y:Z = 4:5, FIND X:Y:Z?