General UNIX interview questions with answers

UNIX is an another Operating System like Linux , Windows etc. Here I have collected UNIX interview questions with their answers for your reference. If you require download UNIX Faqs in PDF format.

UNIX is a family of stable multi-tasking, multi-user for desktops, laptops and servers. Like the Microsoft Windows, UNIX systems have a graphical user interface (GUI) which offers an environment that is easy to use.

From the point of view of the user or programmer, Unix systems are typified by a modular design that is occasionally referred to as the “Unix philosophy”, which means that the operating system presents a set of tools that are simple, with each performing a limited, well-defined function, with a unified filesystem as the major way of communication, with a shell scripting and a command language to add the tools together to execute complex workflows.

UNIX interview questions and answers

For anyone preparing to attend a UNIX interview, here are some of the few questions you may likely be asked:

  1. How do you find a process and kill that?


If you use the “ps -ef” you get a list of all process and use grep to locate your process and get the PID of that process. After getting the PID you can then make use of the kill command to kill that process.

  1. How do you create an archive file in UNIX or Linux Operating System?


An archive can be created in UNIX or Linux by using the tar command you can also create a compressed archive in UNIX by combining tar and gzip

  1. I have read permission on a directory but I am not able to enter it, why?


You cannot go into a directory by making use of the cd command if your directory does not have to execute command.

  1. What is the difference between the break and continue, within a UNIX shell scripting?


If you use a break within a shell scripting loop construct, it will terminate the entire loop. A continue will terminate the current iteration, but the loop will continue on the next iteration.

  1. How do you debug bash script?


Simply add –xv to #!/bin/bash

For instance,

#!/bin/bash –xv

  1. How do you check if file exists on filesystem?


If [-f/var/log/messages]


echo “File exists”


  1. Provide an example on how to write function


Function example {

echo “Hi everyone!”


  1. What is Paging?


Only required memory pages are moved to main memory for execution

  1. How do you set the path in UNIX?


set path = [directory path]

  1. What is tee command?


Tee command is used for

  • Sending data from the standard point
  • Sending it to standard output
  1. What are filters?


A Filter is a program which filters the data prior to execution on application OR database

  1. What is Shell?


A shell operates as a boundary between the user and the system

  1. What is inode?


The inode is a data structure in a file system. Each inode is able to store the attributes and the location (s) of the disk block of the object’s data.

  1. What is ephemeral port?


Operating systems use Ephemeral ports for client sockets

  1. How do you create readonly file?



touch filename.txt

chmod 400 fileName.txt


  • Quick introduction about UNIX OS

  • Introduction about the term shell in UNIX

  • Should be thorough about session

  • Question about Signal in UNIX

  • Question about Message queue

  • Directory and filenaming in UNIX

  • Definition of terms program and process

  • Different file types in UNIX

  • About sticky bit in UNIX

  • Question about page fault

  • Types of buffering in UNIX