Blog Archives

Unix Interview Questions Preparation Course

This course contains Top 50 Unix interview questions that are asked in a technical interview. The focus is on commands and concepts inside Unix. It is an important topic for a software developer to know about Unix. It is a

Posted in Unix, Unix Interview Questions

How will you find which process is taking most CPU time in Unix?

In Unix, we can use top command to list the CPU time and memory used by various processes. The top command lists the process IDs and CPU time, memory etc used by top most processes. Top command keeps refreshing the

Posted in Unix, Unix Interview Questions

What is the difference between Soft link and Hard link in Unix?

A soft link is a pointer to a file, directory or a program located in a different location. A hard link can point to a program or a file but not to a directory. If we move, delete or rename

Posted in Unix, Unix Interview Questions

How will you find which processes are using a file?

We can use lsof command to find the list of Process IDs of the processes that are accessing a file in Unix. Lsof stands for List Open Files. Sample command is: % lsof /var It will list the processes that

Posted in Unix, Unix Interview Questions

What is the purpose of nohup in Unix?

In Unix, nohup command can be used to run a command in background. But it is different from & option to run a process in background. Nohup stands for No Hangup. A nohup process does not stop even if the

Posted in Unix, Unix Interview Questions

How will you remove blank lines from a file in Unix?

We can use grep command for this option. Grep command gives –v option to exclude lines that do not match a pattern. In an empty line there is nothing from start to end. In Grep command, ^ denotes that start

Posted in Unix, Unix Interview Questions

How will you find the remote hosts that are connecting to your system on a specific port in Unix?

We can use netstat command for this purpose. Netstat command lists the statistics about network connections. We can grep for the port in which we are interested. Exact command will be: % netstst –a | grep “port number”

Posted in Unix, Unix Interview Questions

What is xargs in Unix?

We use xargs command to build and execute commands that take input from standard input. It is generally used in chaining of commands. Xargs breaks the list of arguments into small sub lists that can be handled by a command.

Posted in Unix, Unix Interview Questions

How will you check if a remote host is still alive?

We can use one of the networking commands in Unix. It is called ping. With ping command we can ping a remote host. Ping utility sends packets in an IP network with ICMP protocol. Once the packet goes from source

Posted in Unix, Unix Interview Questions

How will you get the last executed command in Unix?

We can use history command to get the list commands that were executed in Unix. Since we are only interested in the last executed command we have to use tail to get the last entry. Exact command would be as

Posted in Unix, Unix Interview Questions