All Courses
Unix Interview Questions

Unix Interview Questions and Answers

Unix Interview Questions and Answers

In case you’re searching for Unix Interview Questions and answers for Experienced or Freshers, you are at the correct place. Additionally Our Unix Online Training will educate the learners about Unix filesystem, shell intro, filters, processes, sed, regular expressions, and programming tools, shell scripting, networking, HTTP and GGI. Unix system is used in most of the industries like the internet, shipping, security, banking, military and automation. UNIX is designed and identified with one of the old operating system which supports the programmers. Unix Online Course will give key points to choose Unix over other systems such as transparency, simplicity, and extensibility. Google, McDonalds, Amazon, and IBM are the branded companies which use a Unix system for its wide operations. Here we provide the most demanded Unix interview question and answer to help the learners from an interview perspective.

There is a parcel of chances from many presumed organizations on the planet. The Unix advertise is relied upon to develop to more than $5 billion by 2020, from just $180 million, as per Unix industry gauges. In this way, despite everything you have the chance to push forward in your vocation in Unix Development. Gangboard offers Advanced Unix Interview Questions and answers that assist you in splitting your Unix interview and procure dream vocation as Unix Developer.

Best Unix Interview Questions and Answers

Do you believe that you have the right stuff to be a section in the advancement of future Unix, the GangBoard is here to control you to sustain your vocation. Various fortune 1000 organizations around the world are utilizing the innovation of Unix to meet the necessities of their customers. Unix is being utilized as a part of numerous businesses. To have a great development in Unix work, our page furnishes you with nitty-gritty data as Unix prospective employee meeting questions and answers. Unix Interview Questions and answers are prepared by 10+ years experienced industry experts. Unix Interview Questions and answers are very useful to the Fresher or Experienced person who is looking for the new challenging job from the reputed company. Our Unix Questions and answers are very simple and have more examples for your better understanding.

By this Unix Interview Questions and answers, many students are got placed in many reputed companies with high package salary. So utilize our Unix Interview Questions and answers to grow in your career.

Q1) How to create the duplicate root user?

Answer: useradd –o –u 0 –g root <username>

Q2) What is the command to check the user belongs to how many groups?

Answer: groups <username>

Q3) How add 45 days to the current system date?

Answer: date –d “+45days”

Q4) What are the default permissions of a file and directory?


  • The default permissions of a file = 666
  • The default permissions of a directory = 777

Q5) Can we login to the user without password?

Answer: Yes, we can login.

Q6) How to put never expiry to a user?

Answer: passwd –x -1 <user login name>

Q7) Which one is the default sticky bit directory?

Answer: /tmp is the default sticky bit directory.

Q8) Can we mount/unmounts the O/S file system?

Answer: No, we cannot mount or unmounts the O/S file system.

Q9) How to make a file system in Linux?

Answer: # mkfs.ext2/ext3/ext4/xfs/vfat<device name>(for example/dev/sdc1)

Q10) How to see the usage information of mounted partions?

Answer: df –ht   (to see device name, file system, size, used, available size, use% and mount point)

Q11) What are the attributes of the file system?


  • Lnode number
  • File name
  • Data block

Q12) Which type of system problems you face?


  • File system full
  • File system corrupted

Q13) How to unmounts a file system forcefully?


  • umount –f <mount point>
  • fuser –ck <mount point>

Q14) How to know the file system type?

Answer: df –ht

Q15) How to know which file system occupy more space and top 10 file systems?

Answer: df –h   <device or partition name> | sort –r | head  -10

Q16) What is the command to know the mounted file systems?

Answer: mount  or # cat /etc/mtab

Q17) How to give permission for folder?

Answer: Chmod –m 777 foldername

Q18) How to find how many disk are attached to the system?

Answer:  fdisk  -I   (to see how many disk are attached to the system)

Q19) What is networking?

Answer: It is a connection between two or more computers to communicate with each other.

Q20) What is media?

Answer: Media is nothing but cable to connect two or systems. Example: RJ 45, CAT 5 and CAT 6,….etc.,

Q21) What are the benefits of NIC Teaming?

  • Load balancing
  • Fault Tolerance
  • Failover

Q22) What is the use of /etc/resolve.conf?

Answer: It contains the details of nameserver, i.e., details of your DNS server which helps us connect to internet

Q23) What is the use of /etc/hosts file?

Answer: To map any hostname to its relevant IP address

Q24) What is the command to check all the open ports of remote machine?

Answer: nmap   localhost

Q25) What is the command to check all the listening ports and services of your machine?

Answer: netstat -ntulp

Q26) What is disabled mode in SELinux?

Answer: SELinux is turned off and on warning and log messages will be generated and stored.

Q27) What is the command to see the SELinux mode?

Answer: getenforce (to check the SELinux mode)

Q28) How to start the graphical interface if the system is in run level 3 now?

Answer: startx (it changes the run level 3 to 5 and reboots the system)

Q29) How many links will be created when we create the directory?

Answer: Whenever we create any directory there are two links will be created.

Q30) What is the command to see the system architecture?


  • arch
  • uname -m

Note: (both commands gives the architecture of the system)

Q31) How to check the version of the O/S?

Answer:  cat /etc/redhat-release  (gives the version of the O/S)

Q32) How to see the run level?

Answer:  who  -r (to see the current run level)

Q33) Which run level are you using?

Answer: Run level 3

Q34) How to know currently scheduled at jobs?

Answer:  atq  (to see the currently scheduled at jobs)

Q35) What is software?

Answer: Software is a collection of programs to perform some tasks or manage systems, applications, databases,…etc.,

Q36) How to copy file one folder to another folder?

Answer: Cp filename destinationpath

Q37) What are the dump devices?


  • Tape drives
  • Disks (local disks)
  • Luns (network disks)

Q38) What is FTP?

Answer: FTP stands for file transfer protocol used to transfer files from one host to another host over a TCP-based network.

Q39) How to delete the table from the database?

Answer: mysql or mariadb>drop table <table name>;
Example: mysql or mariadb > drop table mydetails;

Q40) What is the service group in vertias cluster?

Answer: Services group is made up of resources and their links which we normally requires to maintain the high availability for the appicaion.

Q41) What is the use of ‘halink’ command?

Answer: halink command is used to link the dependencies of the resources.

Q42) Which are the different layouts for vxvm?


  • Mirror
  • Stripe (default)
  • Concate
  • Raid 5
  • Stripe-mirror
  • Mirror-stripe

Q43) How to check the status of the Veritas cluster?

Answer: hastatus -summary

Q44) How will you check the status of the individual resources of Veritas Cluster (VCS)?

Answer: hares -state <resource name>

Q45) How to switch over the services group?

Answer: hagrp  -switch <system A><system B>

Q46) How to online the service group in VCS?

Answer: hagrp  -online <service group name> -sys  <System A>

Q47) How many types of clusters available?


  • Hybrid Cluster
  • Parallel Cluster
  • Failover Cluster

Q48) How to move file current location to another location?

Answer: Mv filename destinationpath

Q49) What is the command used to relocate a service to another node?

Answer:  clusvcadm –r service_name –m node_name

Q50) What is recovery or restore?

Answer: Copying files from any removable media to local disk is called recovery or restore. Backup will be helped in hardware failure or software failure or system crashed.

Q51) Define UNIX

Answer: UNIX is an operating system used for effective multiuser and multitasking functions which was developed by Dennis Ritchie, Ken Thompson, Joe Ossanna and Douglas McIlroy.  Basically, UNIX was written in C Language and it can run on different hardware platforms because of its portability.

Q52) What is meant by Kernel?

Answer: Kernel is defined as the key component of the system which controls everything over the Unix OS. Kernel doesn’t communicate with user directly. It will start a new interactive separate program known as shell given to every user when user login.

Q53) Why “chmod” command is used?

Answer: chmod means changing mode which is the most commonly used command in UNIX. It is normally used to set or change the permission (read, write, execute) of the file or directory. Below 2 modes are used for chmod command

  • Absolute or Numeric mode
  • Symbolic mode
Syntax for chmod command: chmod [permission] [filename] Example for chmod in Symbolic mode:  chmod r- – w- – x– sample.txt
Example for chmod in Numeric mode:  chmod 777 sample.txt

Q54) What is a Shell?

Answer: A Shell, also known as a command interpreter is used as an interface between the system and a user.  Shell intakes the commands from the user and executes them.  The functions of Shell are as follows

  • Execution of Program
  • Redirection of input and output
  • Controlling the environment

Q55) What are the common shells?

Answer: Commonly used Shells are

  • Bash shell(Bourne again shell)
  • Csh/Tcsh shell(C shell/Enhanced C shell)
  • Ksh shell(Korn shell)
  • Zsh shell
  • Fish(Friendly Interactive shell)

Q56) What are the commands used to delete the files in UNIX?


The command for deleting the files in UNIX: “rm –r*”.
“rm” – command for deletion of files
“-r”   – command for deletion of directories as well as sub-directories that                                                includes within a file
“*”    – command to show all entries

Q57) What are the different types of pathnames in UNIX?

Answer: There are 2 types of pathnames in UNIX system. They are as follows

  • Relative path-A Relative path is defined as the pathname which is relative to current location/path.
  • Absolute path-An Absolute path is defined as the complete pathname defining a location of file or directory  from a start of actual root directory

Q58) What is meant by Directory?


  • A directory is defined as the special form of file which contains list of all files that are included into it.
  • Each file is assigned to the directory.

Q59) Give the commands to find today’s date and time?


  • The command which is used for fetching the current date is ‘date’ command

Example: bash-4.3$
bash-4.3$ date 

  • The command which is used for fetching the time is ‘time’ command

Example: bash-4.3$
bash-4.3$ time 

Q60) Give the use of “nohup” command in UNIX?


  • “nohup” in UNIX is a command which is to run the process in background.
  • Even if the user logged off from system, the process will not terminate when ‘nohup’ command is used

Q61) Mention the benefits of executing the process in background?    

Answer: The main benefit of executing the process in background is to execute any other process at any time without the completion of previous process. A Shell is instructed to execute a given command at the background by giving ‘&’ symbol during the end of process.

Q62) Give the difference between “diff” and “cmp” commands

Answer: Generally, both these two commands are used for comparing the files; still there exists a basic difference between these two commands.
cmp command: cmp command is used for comparison of two files byte to byte, in which first mismatch is displayed
diff command: diff command is used for display/indicate the changes that needs to be done in one file to make two files similar.

Q63) What is meant by file permission in UNIX?

Answer:  Each directory/file in UNIX is given access to following 3 categories of owners

  • Group
  • User
  • Others

Each file/directory in UNIX is given 3 permissions as follows

  • Write
  • Read
  • Execute

Example: rw- r– rwx

              r represents for read permission. w represents for write permission. x represents for execution permission. – represents no permission.

                First 3 letters (rw-) represents ownership of user who have read and write access for the file/directory. Second 3 letters(r–) represents ownership of group who have only read access for the file/directory. Third 3 letters (rwx) represents ownership of others who have read, write, and execute access for the file/directory.

Q64) Mention the command used to check the running process currently in UNIX?


  • The command which is used for checking current running process in Unix is “ps -ef

Example: bash-4.3$
bash-4.3$ ps -ef

  • To find specific process running status, grep with pipe is used

Example: bash-4.3$
bash-4.3$ ps -ef | grep [process name]

Q65) Mention the command used to get the disk space usage in UNIX ?


  • The command in UNIX to get detailed usage of disk space is “df -kl
  • It displays the file system, total space, used space, available space, used space percentage, mount system information

Example:  bash-4.3$
bash-4.3$ df -kl

Q66) Mention the basic difference between mount command and unmount command.

Mount Command:  As per the name implies, the mount command is used for mounting a file system or storage device into an existing active directory and therefore making them accessible to the end-users.
Unmount command: Unmount command is used for unmounting the file system which is already mounted by safely segregating it. Also, this command is used for completing the pending read as well as write operations which will be informed to the system.

Q67) Display the commands which are used to fetch the user information

Answer: The various lists of commands which are used to fetch the user information in UNIX are as follows.

  • who- command used to display who logged into the system
  • last- command used to display most recent login of user
  • id- command used to display user id which is active along with group and login details.
  • usermod –a: command used to add an existing user into the group.
  • groupadd admin- command used to add the admin of the group

Q68) Define Pid


  • Pid stands for Process ID
  • Pid is defined as the unique id which is to identify all the process in the Unix which is running either in the background or in foreground
  • Each Pid will be unique in nature

Q69) Briefly explain the terms “system call” and “library functions” in UNIX

System calls:

  • System call function acts as interface which is used within the Kernel.
  • Even though, system call function is not portable fully but it will perform specific tasks on account of user program by sending request to the OS.
  • It refers as standard C function
  • When system call function is invoked, there will be a switch over to kernel from user by the application program

Library functions: 

  • Library functions is defined as the group of normal functions which is not a part of kernel yet it was used by an application
  • Library function is portable in nature
  • In comparison with system calls, it can perform specific tasks in kernel mode only.
  • Library function execution time is lesser in comparison with the system call function execution time.

Q70) Explain the term wildcard interpretation


  • Wildcard characters are special set of characters which is used for representing one or more some other characters.
  • Wildcard Interpretation is defined as the set of command lines consists of wildcard characters
  • If pattern is matched by command (input), then these set of characters are replaced by the list of sorted files.
  • Usually, while processing in UNIX Question mark (?) and Asterisk (*) characters are used as wildcard characters

Q71) Explain the functionalities of Kernel.

Answer:The functionalities of Kernel are as follows:

  • Hardware interaction
  • Memory management system
  • File management system
  • Scheduling of tasks.
  • Allocation of computer resources
  • Resource allotment to different users and tasks

Q72) What is meant by Superblock?


  • Superblock is defined as the program which contains a set of particular specialized file systems.
  • The following lists of data are available in the superblock.
  1. Size of the block
  2. Filled blocks and their count
  3. Empty blocks their counts
  4. Location and size of index node table
  5. Block map of the disk
  6. Block group usage information data
  7. Block group size
  • Usually, Superblock will be created at the creation of file system
  • Every logical partition is mentioned as file system in UNIX and every file system consists of super block, index nodes, data block and boot block.

Q73) Define piping


  • Piping command in UNIX is used for combining more than two commands
  • It is represented by “|” (pipe character)
  • In general, Output of first command will be given as input to the second command and output of second command will be given as input to the third command and goes on.
Syntax: command 1| command 2| command 3 | …….. | command N
Q74) Explain briefly the role of the superuser?
There exist three different kinds of accounts in UNIX. They are as follows

  • User account
  • Root account
  • System account
  • Root account is also known as Superuser
  • A special user type who have complete access to all commands and file systems in a system is called as superuser
  • Login of superuser will be root
  • Superuser login will be protected by root password
  • Superuser will be act as the system administrator
  • Superuser will have access to run any commands in system without restriction

Q75) List the network commands in UNIX

Answer: The commonly used network commands in UNIX are as follows

  • telnet = command which is to communicate with other hostname and also it is enables the user to login remotely
  • ping = command which is to check testing/network connectivity
  • Ftp = ftp stands for file transfer protocol. It is used for file transmission from and to remote server
  • su = command used to switch the user
  • hostname = command which is to display domain name and ip address
  • xtraceroute = command to find response time and hoops count to reach host
  • netstat = command to get different information like statistics of interfaces, tables routing and information on network connection

 Q76) Define file system and its features.


  • Every data are organized in UNIX into files.
  • A file system is defined as the collection of file/directories or functional unit, in which disk is used for file storage and entries of index nodes.
  • Files are ordered in multi-layered tree like structure called directory tree.
  • Root is a directory which is present at the top of file system and root is denoted by “/” symbol.

Some of the features of file system are as follows:

  1. File systems does not have any dependency with another file system
  2. All file/directory is identified uniquely by following parameters:
    • Unique identifier
    • Name
    • File system residing directory
  3. Root is a directory that contains other files/directory which is present at the top of file system and root is denoted by “/” symbol
  4. All files in UNIX are ordered into a multi-layered tree like called “Directory tree”

Q77) Mention the list of commands to fetch the character count and line count in a file.

  • Command to fetch the character count in a file: wc –c [filename]

Example:  bash-4.3$
bash-4.3$ wc –c sample.txt
258 sample.txt

  • Command to fetch the line count in a file: wc –l [filename]

Example:  bash-4.3$
bash-4.3$ wc –l sample.txt
18 sample.txt

Q78) What are the commands to list the files in UNIX?

Command used to list the files/directory in UNIX is “ls”
Syntax: ls [option] [file name/directory name] Different options used for listing command as below

  • ls –l : long format listing
  • ls –r: reverse order listing
  • ls –t: date & time sorting
  • ls –a: all files listing including files which are hidden
  • ls –d: directories listing
  • ls –s: file size listing
  • ls –S: file size sorting
  • ls –R: recursive listing
  • ls –i: index number listing
  • ls –ls: long format with file size listing
  • ls –X: extension name sorting

Q79) Define the need of “echo” keyword in UNIX


  • “echo” is a command used for displaying all files in present directory
  • It is more similar to listing(ls) command
  • It is also used to display a line of data/text

Example 1: To print “Hi, World!” on console
bash-4.3$ echo “Hi, World!”
Hi, World!
Example 2: To print the value of x, where x=5.
bash-4.3$ echo $x

Q80) Give the UNIX command to create and delete a directory?


  • The Command which is used for creating a directory is

mkdir [directory name]
Eg: mkdir mydir

  • The command which is used for deleting a directory is

rmdir [directory name]
Eg: rmdir mydir

 Q81) Mention the ways to Kill process in UNIX?

Answer: On of the way to kill the process in UNIX is by using kill command. By giving process id (pid) as an parameter, process can be killed.

Syntax: kill (process id)

Q82) What are the different types of file available in UNIX?

Answer:The different types of files available in UNIX are as follows:

  • Character special files
  • Regular files
  • Symbolic links
  • Socket
  • Directory files
  • FIFO(First In First Out)
  • Block special files

 Q83) List out basic commands in UNIX.


  • cat – concatenate the contents of the file and print
  • cd – change directory
  • chmod- change mode
  • grep – print lines that are matching a specific pattern
  • kill – to kill the process
  • ls – to list files/directory
  • mail – to read or send mail
  • man – displays online manual pages
  • mv – to move files and rename files
  • passwd – to change the current password of the user
  • pwd – displays current working directory path
  • ps – displays active process

Q84) Discuss the use of SCP command in UNIX?


  • SCP stands for securely copy files
  • SCP command is to copy the files and directory securely from one server to another server without using FTP session
  • It uses SSH terminal for file transfer, therefore user need to enter password/passphrase for authentication
  • SCP encrypts all the exchanged files or password/passphrase so that no one outside the network will view it
Syntax: scp [options] username1@servername_host: directory1/filename1
Username2@servername_host: directory2/filename2

Q85) What is meant by filter?


  • The filter is a common program, where standard input is taken as input, some actions are performed on the given input and standard output will be displayed as a result.
  • Standard input can be either typed through keyboard or by giving the output of file as an input or any input of other files.
  • Standard output will be displayed in the default display screen
  • Filter is also defined as the program which is used in a pipeline in-between any other two programs.
Social Share:

0 responses on "Unix Interview Questions and Answers"

Leave a Message

Your email address will not be published. Required fields are marked *