Wednesday 30 August 2023

Linux interview questions

 1.What is Apache HTTP Server?


The Apache HTTP Server, commonly referred to as Apache, is an open-source web server software widely used to serve websites and web applications.

You can use the following commands:

To start: sudo systemctl start apache2 (or httpd depending on the distribution)

To stop: sudo systemctl stop apache2 (or httpd)


2.What is  web server configuration?


A web server is software that serves web content (HTML files, images, etc.) to clients over the internet using HTTP or HTTPS protocols.

Which popular web servers are commonly used in Linux?


Apache HTTP Server (httpd) and Nginx are two of the most commonly used web servers in Linux.

What is a virtual host in the context of a web server?


A virtual host allows a single physical server to host multiple websites or domains, each with its own configuration and content.

How can you install the Apache web server on a Linux system?


For Debian-based distributions: sudo apt-get install apache2

For Red Hat-based distributions: sudo yum install httpd


3.What is LVM?


LVM, or Logical Volume Manager, is a storage management technology that allows you to manage and organize physical storage devices (disks) as logical volumes.

What are the main components of LVM?


The main components of LVM are Physical Volumes (PVs), Volume Groups (VGs), and Logical Volumes (LVs).

What is a Physical Volume (PV)?


A Physical Volume is a physical storage device, such as a hard disk or a partition, that is used as a building block for LVM.

What is a Volume Group (VG)?


A Volume Group is a collection of one or more Physical Volumes. It acts as a pool of storage that can be divided into Logical Volumes.


4.What is FTP?


FTP (File Transfer Protocol) is a standard network protocol used to transfer files between a client and a server over a network, typically the internet.

How do you install an FTP server on a Linux system?


Common FTP server software includes vsftpd (Very Secure FTP Daemon) and proftpd. Installation commands may vary by Linux distribution.

What are the default ports used by FTP for data and control connections?


FTP control connections use port 21 by default, and data connections use additional ports (active mode) or a range of passive ports (passive mode).


5.What is SMTP?


SMTP (Simple Mail Transfer Protocol) is a protocol used for sending and relaying email messages between email servers and clients.

What are the standard ports used by SMTP for sending and receiving emails?


The standard port for outgoing SMTP (SMTP client to server) is port 25, and the standard port for incoming SMTP (server to server) is port 25.

How do you install an SMTP server on a Linux system?


Popular SMTP server software includes Postfix, Sendmail, and Exim. Installation methods may vary depending on the Linux distribution.


6.What is Samba?


Samba is an open-source software suite that allows Linux and Unix systems to share files, folders, and printers with Windows systems using the SMB/CIFS protocol.

How do you install Samba on a Linux system?


You can install Samba using package management tools. For example, on Debian-based systems: sudo apt-get install samba.


7.What is RPM?


RPM (Red Hat Package Manager) is a package management system used in Red Hat-based Linux distributions to manage software packages.

What is the purpose of RPM packages?


RPM packages contain software, files, and metadata required for installation, upgrading, or removal of software on a Linux system.

How do you install an RPM package?


You can use the rpm command to install RPM packages.


8.What is NFS?


NFS (Network File System) is a protocol that allows clients to access files and directories on remote servers as if they were local. It's used for sharing files and resources across a network.

How does NFS work?


NFS works by allowing a client system to mount remote directories as if they were local filesystems. This enables users to access and manipulate remote files seamlessly.

What is an NFS export?


An NFS export refers to a directory on a server that is made available for access by NFS clients. Clients can mount this export to access its contents.

How do you install and configure NFS on a Linux system?


Install the NFS server software (e.g., nfs-utils package), configure the exports in the /etc/exports file, and start the NFS server service.


9.What are the common methods of installing software on a Linux system?


Common methods include package managers (apt, yum, dnf), downloading and compiling source code, using software centers, and using graphical installers.

What is a package manager?


A package manager is a tool that automates the process of installing, upgrading, configuring, and removing software packages on a Linux system.

How do you install software using a package manager on a Debian-based system?


Use the apt-get or apt command followed by the package name. For example: sudo apt-get install package-name.


10.What is the booting process in Linux?


The booting process is the sequence of events that occur when a computer is powered on, leading to the loading of the operating system and the initiation of user sessions.

Explain the main stages of the Linux booting process.


The main stages are: BIOS/UEFI, bootloader (e.g., GRUB), kernel initialization, initial RAM disk (initramfs), user space initialization (init/systemd), and user login.

Intermediate Booting Process Questions:


What is the role of the BIOS/UEFI in the booting process?


BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) performs hardware initialization, self-tests, and loads the bootloader from the boot device.


11.What are the file permissions in Linux?

There are 3 types of permissions in Linux OS that are given below:


Read: User can read the file and list the directory.

Write: User can write new files in the directory.

Execute: User can access and run the file in a directory.



12.What are port numbers in networking?

HTTP (Hypertext Transfer Protocol) - Port 80

HTTPS (HTTP Secure) - Port 443

FTP (File Transfer Protocol) - Port 21

SSH (Secure Shell) - Port 22

SMTP (Simple Mail Transfer Protocol) - Port 25


13.What is GUI and CLI?

GUI: GUI stands for Graphical User Interface. It is a human-computer interface that permits users to collaborate with electronic devices through visual indicators and graphical icons. The use of these graphical icons or elements makes it convenient for the user to collaborate with the system. It's visually intuitive and permits higher productivity. It uses the images and the icons which are clicked by the users to communicate with the system. It is more attractive and user-friendly because of the use of the images and icons.


CLI: CLI stands for Command Line Interface. It is a command-line program that takes text as input to run the tasks of the OS. It permits users to enter declarative commands to give instructions to the system to perform operations. It needs less memory than other interfaces, and it doesn't need Windows because a low-resolution monitor can also be used. It is an interface that allows users to type declarative commands to instruct the computer to perform operations.


14.What is a root account?

The root account is like a system administrator account. It provides you full control of the system. You can create and maintain user accounts, assign different permission for each account, etc.


15.How to exit from vi editors?

The following commands are used to exit from vi editors.


:wq saves the current work and exits the VI.

:q! exits the VI without saving current work.





No comments:

Post a Comment