linux interview questions and answers for experienced 2020

Top 101 Linux Interview Questions And Answers 2021

Today, there are huge opportunities for most of the companies in the world. You have a great chance to create a career in Linux development. The Linux technical interview questions help the candidates in cracking the interview and achieve their dream as a Linux developer. The Linux developers demand is increasing in the industry. If anyone looking to crack the interview then you are at right place. Here we provide a few Updated Linux interview questions and answers for experienced 2021 that help you interview preparation.

Mostly Asked Linux Interview Questions And Answers

Q. 1 – Explain About Linux?

Linux is one of the open source UNIX operating system (OS). It is open source and completely free. It is developed from scratch by the Linus Trovald. This platform is a completely different operating system. It has few distributions such as Fedora, Ubuntu, and others. Linux is everywhere from television, smartwatch, laptop, Smartphone and much more.

Q. 2 – How Many Types Of Processes In Linux?

There are two types of processes in Linux such as background processes and foreground processes. The background process runs on the Linux background. The users can execute the commands before the Linux background process get completed fully. After the command, the users add an & symbol that make it a background process. The Foreground process while started by the developers run in the foreground. The developers need to wait for few minutes to get executed before providing other commands.

Q. 3 – Why Should You Use Linux?

Nowadays, Linux is mostly used for its performance and it is totally different from other OS in the market. It comes with additional features that allow the users to complete the task quickly. It supports different file system and highly secured. Linux is open source OS where the developers gain huge benefits of developing their own custom operating system. It has controllable problems with the malware, virus, and others. The software licensing needed to install Linux is free. These are the main reason for using Linux.

Q. 4 – What Are Swap Space And Its Benefits?

Swap space is the amount of hard-disk storage or physical memory. It is utilized when the system requires large memory space but the storage of the system is full. The swap space is provided for use by the Linux that allow running the programs temporarily. It occurs when the RAM does not have enough storage space to support the running programs. The memory management involves the memory swapping from as well as to physical storage. The inactive memory space is moved to the swap spaces that free RAM storage. There are various types of tools and commands to manage the usage of swap space.

Q. 5 – What is Linux used for?

 However, Linux is used for carrying out big iron systems such as mainframe computers, and the only OS used on TOP 500 super computers. It is now gradually eliminated in all competitors. It is operated on servers and carry high end performances.

Q. 6 – Explain Important Features Of Linux OS

Linux has excellent features that provide you best experience. Here you can get the key features of the Linux operating system.

  1. Linux distros offer live USB or CD for installation.
  2. Linux offers high-security service in different methods such as Encryption, Authentication, and authorization.
  3. It offers the hierarchical file system and Linux code is completely free to all.
  4. You can install Linux kernel as well as an application program on any hardware platform.
  5. Linux has unique application support and customized keyboards.
  6. This platform allows different users to use the same device like an application program, memory and hard disk with the various terminals for operation.

Q. 7 – Explain About Linux Shell

The Linux shell is a user interface that used for executing the communication and commands with the Linux OS. The shell commands can be classified into two types such as external commands and built-in shell commands. There is a lot of the shell available with the Linux that includes TCSH, BASH, KSH, and CSH.

Q. 8 – What Is A Virtual Desktop?

On the current PC, when there are lots of the windows available and appears maximizing as well as minimizing the window their virtual desktop server as an option. The virtual desktop allows users to open more than one program without any error. It is stored on the remote server and it has few benefits such as lower compatibility problems, enhanced data integrity, resource are used effectively, centralized administration, and others.

Q. 9 – What Are The Uses of Linux?

It is similar to the other operating systems that can be used for windows, OS X and iOS. This includes lots of configurations that are capable for updating with enough features. It let them focus on operating systems such as word processing applications and linux equivalents. It is accustomed to using other operating systems.

Q. 10 – What Can You Actually Do With Linux?

There are lots of email applications are carried out in Linux operating system. It includes three most common features which are widely used to come in mind with right flow. This includes Mozilla Thunderbird, Kmail, and others. So, it let the users grab attention on best linux operating systems for varied purposes.

Q. 11 – How Linux will be Utilized?

Like windows and apple operating system, the Linux is also one of the top notch operating system. To update the extraordinary features, here enormous number of configuration will be included. This process will permit to concentrate on the major operating systems like Linux equivalents and word processing applications in an effective manner.

Q. 12 – How The Linux Will Work?

In general, in Linux, there are enormous number of email applications have been used. Those email applications will provide certain basic features that can able to used in the perfect manner. This will include various applications such as Kmail, Mozilla Thunderbird and much more. Linux OS will never get affected with virus.

Q. 13 – What is a Right Typical Size For A Swap Partition Below Linux System?

The suitable size for a swap partition is twice the total amount of the present physical memory found over the system. It is not applicable to minimum size must be the same as the total amount of the memory installed over it. Hope it is helpful to store the right amount in a fine manner.

Q. 14 – How will Find Out How Much Memory Linux is Using?

In a command shell, it makes use of concatenating command: cat/proc/memento for all memory usage data. Then it would see a right light begin something such as Mm: 64655360. It is complete know as the Linux thinks is found to use with more comfort at all time.

Q. 15 – How Will Change Permissions Under Linux?

Think that you are systems administer and owner of file or directory, you can grant permission using the chmod command. It is used +symbols to make permission to deny permission. With any of the following letters such as g (group) o (other) and much more. Here the command chmod go+ rw FIlE1.TXT grant read and obtain the file.

Q. 16 – What is OS?

OS (operating system) is used to provide platform to run our application and software.

Q. 17 – What is kernel?

Kernel is a core part of any Operating system, which is used to interact hardware with software.

Q. 18 – How will you check your kernel version?

uname –a : is a command to check kernel version of your Linux OS.

Q. 19 – How will you check your memory in Linux?

cat /Proc/meminfo :
Or
free –m:

Q. 21 – How will you change your terminal through command?

chvt terminal no

Q. 22 – How will you check your system hardware in Linux?

cat /proc/cpuinfo
Or
lscpu
cat /proc/meminfo
Or
Free –m
cat /proc/partitions
Or
fdisk –l

Q. 23 – What is shell?

Shell is a user interface between user and Operating System.

Q. 24 – How many shells used by Linux?

Many shells are used
less /etc/shells
ksh, sh, csh, tcsh,zsh
Cat /etc/shell

Q. 25 – How will you list all file in directory, Including The Hidden?

ls –al:- this command will show you all file and directory including the hidden into your present working directory.

Q. 26 – What is the port no. of ssh?

Default port no of ssh is 22.

Q. 27 – What Is the port no of telnet?

Default port no of ssh is 23.

Q. 28 – What is the difference between ssh and telnet?

Both for use remote login on system but ssh is more secure than telnet.

Q. 29 – What do you mean by BASH?

BASH or we can say Bourne Again Shell written by Steve Bourne. BASH is responsible for mixing out all the features from the original form of Bourne Shell, also extra features for making it more suitable and easier and to use.

Q. 30 – Define LILO?

A boot loader for the Linux is known as LILO which is used for loading the Linux OS to the main memory for beginning the operations.

Q. 31 – What do you mean by swap space?

Linux uses an amount of space for holding programs briefly which are running alongside and this space is called swap space. This takes place when RAM have small amount of memory for holding the executing programs.

Q. 32 – Define the term root account

The root account acts same as a systems administrator account. It gives you complete control of the system. One can generate and keep user accounts, conveying different permissions for every single account.

Q. 33 – Define the term CLI?

CLI stands for Command Line Interface. This interface gives users permission for typing the declarative commands which then responsible to train the computer for accomplishing various operations. CLI provides superior flexibility.

Q. 34 – What do you mean by GUI?

GUI is short name for Graphical User Interface, making use of icons and images which is clicked by users and operate with the computer as a method of communicating.

Q. 35 – Define symbolic links?

Symbolic links is similar to shortcuts in Windows. Such links point to directories, files or programs. Symbolic links give you immediate access to it. You don’t need to go directly to the complete pathname.

Q. 36 – Write is the maximum length for a filename under the Linux?

The maximum length for a filename under Linux is 255 characters. Path name is not included under this limit. Thus, the whole filename and pathname could surpass 255 characters.

Q. 37 – What is known as pwd command?

The pwd command stands for the Print Working Directory Command.

Q. 38 – Define environmental variables?

Environmental variables are worldwide settings which is used mainly for regulating the shell’s function in additional with other Linux programs. Environmental variables are also known as global shell variables.

Linux Command Interview Questions And Answers

The Linux commands interview questions for experienced and fresher are vital for the people who decide to start a career in the Linux. With the help of below-given question, you can ready for the Linux interview and get a job in a top company with a high salary.

Q. 1  – How will you check all installed packages of ftp?

rpm –qa | grep ftp

Q. 2 – What are the contents of /boot?

/boot: – It contains Grub (boot loader of Linux) kernel (the core part of OS) and booting related files.

Q. 3   – What are the contents of /sbin?

/sbin: – It contain all system command or super user command /usr/sbin.

Q. 4 – What are the contents of /etc?

/etc: – It contain all configuration file and directory used for server.

Q. 5 – What are the contents of /dev?

/dev :- It is a location of the devices file.

Q. 6 – What are the contents of /bin?

/bin :- It contain all executable files or command or user command. /usr/bin also contain user command.

Q. 7 – What is redirection?

Redirection is standard Input/output of the command, which used to displays on the terminal can be redirected into a file.
Common redirection operator
> : command > file : this command will redirect output of command into file
>> : command >> file : this command will append output of command into file
< : command < file : this command will receive input from file
2> : command2 > file : this command will redirect error of command into file
2>> : command2 >> file : this command will append error of command into file
&> : Command &> file : this command will redirect output + error of command to file
&>>: Command &>> file : this command will append output + error of command to file

Q. 8 – What is Aliases?

Aliases are a short name for large commands.
Alias h=history
For permanent entry of alias in .bashrc file
Type:
vim .bashrc
alias h=history
save and exit
For test your change by logging out, logging back and type
h.

Q. 9 – What is swap memory?

It is a virtual memory which is used to increase system performance. Its Hard disk space which we can use as a ram is virtual memory.

Q. 10 – In case if your system does not have unallocated space and you want to increase your virtual memory then how will you do it?

In case the system doesn’t have unallocated space we can create a swap file to increase system performance.

Q. 11 – How to create/make a swap file?

First create a file
#touch /swap

Now assign the size of the swap
# dd if=/dev/zero of=/swap bs=1M count=200

Format your swap file
#mkswap /swap

Active the swap file
#swapon /swap

To check active swap partition
#Cat /proc/swaps

For activate automatically swap file, we will make the entry in /etc/rc.local
# vim /etc/rc.local

Make the following entry
Swapon /swap
Save and exit

Q. 12 – Define the Linux file system hierarchy?

Root : it is a home directory of superuser (root).
Etc : it contains all configuration file and directory used for server Configuration
dev : it contains the device file
home : it is a location of the home directory of regular users
proc : it is a virtual directory.
boot : it contain kernel and boot loader (grub), booting related files.
sys : :it is also a virtual directory and contain system information
media : it is a mount point of the removable disk like cdrom floppy USB drive etc.
tmp : it contains all temporary file
usr : it is used for software installation
lib : it contains all library files of the system
bin : it contains all executable files or command or user command /usr/bin also contain user command
sbin : it contains all system command or superuser command /usr/sbin
mnt : it is a mount point for partition and external devices.
opt : optional directory and used for third party tool installation.
var : it is a variable directory and contains public data (ftp & www), all log and error Message

Q. 13 –  How Linux will show Hard disk Devices?

All the device files are stored in /dev. SCSI, SATA or USB will show: /dev/sda & Old hard disk like IDE, ATA PATA will show /dev/hda

Hard disk ; /dev/sdx

Where x is
a : /dev/sda : Primary master
b : /dev/sdb : Primary slave
c : /dev/sdc : Secondary master
d : /dev/sdd : Secondary slave

Q. 14 – How to check the label of any partition?

#e2label /dev/sdax: where x for partition number

Q. 15 – How to mount CD Rom in Linux?

#mount /dev/cdrom /mnt

Q. 16 – How to mount NFS share in Linux?

#mount –t nfs 10.0.0.1:/nfs /mnt
t : used for define type of mounting point
10.0.0.1:/nfs Define here NFS server machine and share data
/mnt : where you want to access NFS share data you can access in any folder.

Q. 17 – How to mount iso image in Linux?

#Mount –t iso9660 /root/image.iso /mnt

Q. 18 –  How will you check partition id?

#Blkid /dev/sdax : where x for partition number.

Q. 19 – How to run the command on Remote machine?

#ssh 10.0.0.1 reboot
10.0.0.1: IP of that machine where you want to run command.
Reboot: is a command which you want to run you can give another command too.

Q. 20 – Define cpio command?

cpio is a short for Copy in and copy out. Cpio main function is to copy lists, files and abstract files to and from a single or an archive file.

Q. 21 – How do you recognize which package the specified file (/etc/fstab) is connected with in linux ?

We can recognize the package the specified file (/etc/fstab) which is connected with in linux by using 

# rpm -qf /etc/fstab command

Q. 22 – Which command is used for checking the status of bond0 ?

cat /proc/net/bonding/bond0 is used for checking the status of bond0.

Q. 23 – How to find files larger than 10MB in size in /usr directory ?

# find /usr -size +10M -exec ls -lah {} \; command is used to find out files which are larger than 10MB in size in /usr directory.

Q. 24 – How to find files in the /home directory which were modified more than 120 days ago?

To find files in the /home directory which were modified more than 120 days ago, we use –

# find /home -mtime +120

Q. 25 – How to find files in the /var directory that have not been accessed in the last 90 days?

To find files in the /var directory that have not been accessed in the last 90, we use –

# find /var -atime -90

Q. 26 – Search for core files in the entire directory tree and delete them as found without prompting for confirmation.

# find / -name core -exec rm {} \;

Q. 27 – What would the command ll | awk ‘{print $3,”owns”,$9}’ do ?

The main work of ll command is to display file owners and names.

Q. 28 – How to check current run level of a Linux server?

To check current run level of a Linux server, we use –

 ‘who -r’ & ‘runlevel’ commands are used to check the current runlevel of a linux box.

Q. 29 – Which command is used to find out how much memory Linux is using?

To find out how much memory Linux is using, we use –

free - m
vmstat
top
htop

Q. 30 – Write a command that will look for files with an extension “c”, and has the occurrence of the string “apple” in it.

Find ./ -name "*.c" | xargs grep –i "apple"

Q. 31 – Which command is used to display all .txt files, including its individual permission.

ls -al *.txt

Q. 32 – How do you execute more than one command or program from a single command line entry?

We can mix several commands by separating each program or command with the help of a semicolon symbol. For instance, In a single entry, we can issue such a series:

ls –l cd .. ls –a MYWORK which is equivalent to 3 commands: ls -l cd.. ls -a MYWORK

Linux Technical Interview Questions And Answers

Q. 1 – How to copy a file in Linux?

To copy a file in Linux, we use the cp command.

General syntax : $ cp <source> <destination>

Q. 2 – How to rename a file in Linux?

As of now, there is no particular command in Linux which can be used to rename a file. But copy or move command can be used to rename the file.

With the help of Move command

$ mv <oldname> <newname>

With the help of Copy command

$ cp <oldname> <newname>

And then deleting the old file.

$ rm <oldname>

Q. 3 – How to write the output of a command to a file?

To write the output of a command to a file, we use redirection operator (>).

General Syntax: $ (command) > (filename)

Q. 4 – How to see the list of mounted devices on Linux?

By running $ mount -l command, we can see the list of mounted devices on Linux

Q. 5 – How to find the difference in two configuration files?

By using the diff command, we can find the difference in two configuration files

Syntax : $ diff abc.conf xyz.conf

Q. 6 – Write a bash script to delete all the files in the current directory that contains the word “linux”.

for i in *linux*; do rm $i; done

Q. 7 – How to copy files to a Floppy Disk safely?

To copy files to a Floppy Disk safely, we need to follow these steps:

  • Mount the floppy disk
  • Copy the files
  • Unmount the floppy disk

Q. 8 – How to identify which shell you are using?

To identify the shell which you are using you need to first

Open the terminal and then run:

$ echo $SHELL

This will help in printing the name of the Shell which you are using. 

Q. 9 – How can you login to another system in your network from your system?

ssh <username>@<ip address>

Q. 10 – How would you search for a specific Employee ID in a file using the vim editor?

With the help of this command –

$ vim +/<employee id to be searched> <filename>

Q. 11 – How to jump to a particular line in a file using vim editor?

By using listed below command –

$ vim +<line number> <filename>

Q. 12 – How do you sort the entries in a text file in ascending order?

By using the sort command, we can do this.

Syntax : $ sort sample.txt

Q. 13 – How do you check if a particular service in running?

By using $ service <servicename> status command

Q. 14 – How do you check the status of all the services?

To check the status of all the services, we use –

$ service –status-all

Q. 15 – How do you start and stop a service?

For starting a service, we use:

$ service <servicename> start

For stopping a service, we use:

$ service <servicename> start

Linux Interview Questions and Answers for Experienced

Q. 1 – What are the benefits of CLI

The benefits of CLI are as follows:

  • It is flexible
  • CLI can effortlessly access commands
  • It is much easier and faster to use by professional
  • CLI does not use plentiful CPU processing time.

Q. 2 – What are the Drawbacks of CLI

The drawbacks of CLI are as follows:

  • It is very hard to remember and learn type commands.
  • CLI has to be entered exactly.
  • It can be very puzzling.
  • Graphics, Surfing web, etc. are some responsibilities that are tough or we can say impossible to complete on the command line.

Q. 3 – Name some important Linux distributors

Some major Linux distributors are as follows:

  • Linux Mint
  • Fedora
  • Ubuntu
  • Arch Linux
  • Debian
  • Red Hat Enterprise

Q. 4 – What are the methods that determine the total memory used by Linux

Below are the ways which determine the total memory used by Linux

  • Top command
  • /proc/meminfo
  • Htop
  • Free command
  • Vmstat

Q. 5 – Write some of the Linux Directory commands.

Some of the Linux Directory commands are as follows:

  • Cd
  • Mkdir
  • Pwd
  • Is
  • Rmdir

Q. 6 – Enlist some Linux to file content commands

  • more
  • less
  • cat
  • tail
  • head

Q. 7 – Write some Linux networking and troubleshooting commands?

Some Linux networking and troubleshooting commands are as follows –

  • ifconfig
  • netstat
  • Traceroute
  • Ifplugstatus
  • Hostname
  • Dig.
  • Route
  • Tracepath
  • Mtr
  • Ping
  • nslookup

Q. 8 – What is the general syntax for changing permission using Symbolic mode?

To change permission using Absolute mode, The general syntax is:

$ chmod <permission> filename

Q. 9 – What is the general syntax for changing permission using Absolute mode?

To change permission using Symbolic mode, The general syntax:

$ chmod <target>(+/-/=)<permission> <filename>

Q. 10 – How to find the status of a process?

 By using ps ux command we can find the status of process.

Q. 11 – What are the basic components of Linux?

The basic components of Linux are given below:

  • GUI
  • System Utilities
  • Shell
  • Application Programs
  • Kernel

About the Author

Robert Wagner (Information Technology)

Robert Wagner is an IT expert and a consultant having more than 35 years of experience in Information Technology. He loves to write about the latest skills and jobs in demand to make our generation aware about the top skills and certifications in IT.

Leave a Reply

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

You may also like these

No Related Post