DEV Community

Abhishek Gupta
Abhishek Gupta

Posted on

Linux Server Administration – Most Important Questions (BCA-III)

Q1. Explain the following terms in Linux

(a) Checking Disk in Linux

Image

Image

Image

Checking Disk in Linux means checking the hard disk for errors and seeing how much space is used or free.

Why disk checking is needed

  • To find and fix disk errors
  • To avoid data loss
  • To know available disk space

Common commands

  • fsck – checks and fixes disk errors
  • df – shows free disk space
  • du – shows space used by files and folders

Example

df -h
Enter fullscreen mode Exit fullscreen mode

In short

Checking disk helps keep the system safe, fast, and error-free.


(b) System Setup and Shutdown Process in Linux

Image

Image


1. System Setup (Booting Process)

System setup means how Linux starts when we turn on the computer.

Steps

  1. Computer is turned ON
  2. BIOS/UEFI checks hardware
  3. Bootloader loads Linux
  4. Kernel starts system work
  5. Login screen appears

In short

System setup is the process of starting Linux.


2. Shutdown Process in Linux

Shutdown process means properly turning off the system.

Steps

  1. Shutdown command is given
  2. Running programs are closed
  3. Files are saved
  4. Disk is unmounted
  5. System power is turned OFF

Example command

shutdown -h now
Enter fullscreen mode Exit fullscreen mode

In short

Shutdown safely stops the system without data loss.

Q2. What is Linux? What are the advantages of Linux?

What is Linux?

Linux is a free and open-source operating system. It works as an interface between the user and the computer hardware.
Linux manages hardware resources such as CPU, memory, files, and devices, and allows users to run programs.

Linux was created by Linus Torvalds in 1991.
It is widely used in servers, computers, mobiles, supercomputers, and embedded systems.

In simple words

Linux is an operating system that controls the computer and helps users perform tasks.


Advantages of Linux

1. Free and Open Source

  • Linux is free to use.
  • Source code is available for modification.

2. Secure

  • Strong user permission system.
  • Less affected by viruses and malware.

3. Stable and Reliable

  • Runs for a long time without crashing.
  • Mostly used in servers.

4. Multiuser Support

  • Many users can work on the same system at the same time.

5. Multitasking

  • Can run multiple programs at once smoothly.

6. Good Performance

  • Works well even on low-configuration systems.

7. Strong Networking Support

  • Excellent support for networking and servers.

Q3. What is Linux File System? Describe Linux File System in brief.

What is Linux File System?

Image

Image

Image

The Linux File System is the method used by Linux to store, organize, and manage files and directories on a disk.
It defines where files are stored, how they are named, and how users access them.

In Linux, everything is treated as a file, including devices and directories.


Linux File System Structure (In Brief)

Linux follows a tree structure that starts from the root directory /.

Important Directories

  • / (Root)

    • The main directory of the Linux file system.
  • /bin

    • Contains essential user commands (like ls, cp).
  • /etc

    • Stores system configuration files.
  • /home

    • Contains user personal directories.
  • /usr

    • Contains user programs and applications.
  • /var

    • Stores variable data like logs and emails.
  • /tmp

    • Stores temporary files.
  • /dev

    • Contains device files (hard disk, USB, etc.).

Features of Linux File System

  • Hierarchical (tree-like) structure
  • Strong file permissions (read, write, execute)
  • Supports large files
  • Secure and reliable

Q4. Discuss file comparison commands cmp and comm

File Comparison in Linux

In Linux, file comparison commands are used to compare two files and find differences or similarities between them.

Two important commands are cmp and comm.

1. cmp Command

The cmp (compare) command is used to compare two files byte by byte.

Features

  • Checks whether two files are exactly the same
  • Stops at the first difference
  • Mostly used for binary files or exact comparison

Syntax

cmp file1 file2
Enter fullscreen mode Exit fullscreen mode

Example

cmp a.txt b.txt
Enter fullscreen mode Exit fullscreen mode

Output

  • If files are the same → no output
  • If different → shows byte number and line number where difference occurs

In simple words

cmp tells whether two files are identical or not.


2. comm Command

The comm command is used to compare two sorted text files line by line.

Features

  • Works only on sorted files
  • Divides output into three columns

Syntax

comm file1 file2
Enter fullscreen mode Exit fullscreen mode

Output Columns

  1. Lines only in file1
  2. Lines only in file2
  3. Lines common in both files

Example

comm file1.txt file2.txt
Enter fullscreen mode Exit fullscreen mode

In simple words

comm shows which lines are same and which are different in two text files.


Difference Between cmp and comm

cmp comm
Compares byte by byte Compares line by line
Works with any file Works only with sorted text files
Stops at first difference Shows full comparison
Used for exact match Used for text comparison

Q5. What is a Process?

A process in Linux is a program that is currently running.
When a program is executed, it becomes a process.

In simple words:

Program + Execution = Process


Explanation

  • A program is a set of instructions stored on disk.
  • A process is that program running in memory.
  • Each process has:

    • A Process ID (PID)
    • Its own memory
    • CPU time
    • Input and output resources

Linux can run many processes at the same time.


Types of Processes

  • Foreground Process – runs directly on the terminal
  • Background Process – runs in the background

Example

ps
Enter fullscreen mode Exit fullscreen mode

This command shows running processes.

Q6. Explain the following Linux commands

1. ls – List files

Used to show files and folders in a directory.

ls
Enter fullscreen mode Exit fullscreen mode

2. mkdir – Create directory

Used to create a new folder.

mkdir myfolder
Enter fullscreen mode Exit fullscreen mode

3. less – View file content

Used to read file content page by page.

less file.txt
Enter fullscreen mode Exit fullscreen mode

4. cp – Copy files

Used to copy files or directories.

cp file1.txt file2.txt
Enter fullscreen mode Exit fullscreen mode

5. who – Show logged-in users

Shows users currently logged into the system.

who
Enter fullscreen mode Exit fullscreen mode

6. cut – Extract columns

Used to extract specific columns or fields from text.

cut -d"," -f1 data.txt
Enter fullscreen mode Exit fullscreen mode

7. sort – Sort data

Used to sort file content in alphabetical or numeric order.

sort names.txt
Enter fullscreen mode Exit fullscreen mode

8. ps – Show running processes

Displays currently running processes.

ps
Enter fullscreen mode Exit fullscreen mode

9. grep – Search text

Used to search a word or pattern in a file.

grep "linux" file.txt
Enter fullscreen mode Exit fullscreen mode

10. wc – Count lines, words, characters

Used to count lines, words, and characters in a file.

wc file.txt
Enter fullscreen mode Exit fullscreen mode

11. dd – Copy and convert data

Used to copy data from one file to another, often for disk operations.

dd if=input.txt of=output.txt
Enter fullscreen mode Exit fullscreen mode

Q7. What do you mean by Process Scheduling?

Process Scheduling is the method used by the Linux operating system to decide which process will use the CPU and for how long.

Since many processes are ready to run at the same time and there is only one CPU, Linux schedules them so that each process gets CPU time.

Process Scheduling is the technique used by Linux to manage and allocate CPU time among multiple running processes so that the system works efficiently.


Explanation (Easy Words)

  • Multiple processes exist in memory.
  • All processes cannot run at the same time.
  • The scheduler selects one process and gives it CPU time.
  • After some time, the CPU is given to another process.

This creates the illusion of multitasking.


Objectives of Process Scheduling

  • Efficient use of CPU
  • Fair sharing of CPU time
  • Fast response to users
  • Avoid starvation of processes

Q8. Explain at and batch commands with syntax and example

In Linux, at and batch commands are used to schedule commands to run later.


1. at Command

The at command is used to run a command at a specific time in the future.

Syntax

at time
Enter fullscreen mode Exit fullscreen mode

Example

at 5:00 PM
Enter fullscreen mode Exit fullscreen mode

Then type the command:

echo "Hello Linux" > test.txt
Enter fullscreen mode Exit fullscreen mode

Press Ctrl + D to save.

Explanation (Easy)

  • The command will run only once
  • It runs at the given time

In short

at is used to schedule a job at a fixed time.


2. batch Command

The batch command is used to run commands when the system load is low.

Syntax

batch
Enter fullscreen mode Exit fullscreen mode

Example

batch
Enter fullscreen mode Exit fullscreen mode

Then type:

cp bigfile.txt /backup/
Enter fullscreen mode Exit fullscreen mode

Press Ctrl + D.

Explanation (Easy)

  • Job runs automatically
  • Runs when CPU is free
  • Time is not fixed

In short

batch runs jobs when system is idle.


Difference Between at and batch

at batch
Runs at fixed time Runs when system load is low
Time is specified No fixed time
One-time job One-time job
User decides time System decides time

Q9. How does Linux manage multiple processes in a system?

Linux manages multiple processes using multitasking and process scheduling so that many programs can run at the same time smoothly.

Explanation

  • In Linux, many processes are present in memory.
  • The CPU can execute only one process at a time.
  • Linux uses a scheduler to switch the CPU very fast between processes.
  • Each process gets a small amount of CPU time.
  • Because switching is very fast, it looks like all programs are running together.

Key Ways Linux Manages Multiple Processes

1. Process Scheduling

  • Linux decides which process runs next.
  • CPU time is shared among all processes.

2. Time Sharing

  • Each process gets a time slice.
  • After the time ends, CPU moves to another process.

3. Process States

Processes can be in different states:

  • Running
  • Ready
  • Waiting
  • Stopped

4. Context Switching

  • Linux saves the state of one process.
  • Loads the state of another process.
  • This allows smooth switching between processes.

Example

If you:

  • Listen to music
  • Use a browser
  • Edit a file

Linux manages all these using process scheduling and time sharing.

Q10. Explain the use of conditional and looping statements in Linux Shell Programming

In Linux Shell Programming, conditional and looping statements are used to control the flow of a shell script.


1. Conditional Statements in Shell Programming

Conditional statements are used to make decisions in a shell script.
They execute commands only if a condition is true.

Purpose

  • To check conditions
  • To take decisions
  • To control execution of commands

Common Conditional Statement: if

Syntax

if [ condition ]
then
   commands
fi
Enter fullscreen mode Exit fullscreen mode

Example

if [ $a -gt $b ]
then
   echo "a is greater than b"
fi
Enter fullscreen mode Exit fullscreen mode

In simple words

Conditional statements help the script decide what to do.


2. Looping Statements in Shell Programming

Looping statements are used to repeat a set of commands multiple times.

Purpose

  • To avoid writing the same code again and again
  • To perform repetitive tasks

Types of Loops

(a) for Loop

Runs commands for a fixed number of times.

Syntax

for i in 1 2 3
do
   echo $i
done
Enter fullscreen mode Exit fullscreen mode

(b) while Loop

Runs commands while a condition is true.

Syntax

while [ $i -le 5 ]
do
   echo $i
   i=$((i+1))
done
Enter fullscreen mode Exit fullscreen mode

Difference Between Conditional and Looping Statements

Conditional Looping
Used for decision making Used for repetition
Executes once Executes many times
Uses if Uses for, while

Q11. What is Shell Programming?

Shell Programming is the process of writing a set of commands in a file (script) so that Linux can execute them automatically.

The shell acts as an interface between the user and the Linux operating system.
When we write commands in a script file and run it, this is called shell programming.

Explanation (Easy Words)

  • Shell is a command interpreter.
  • Shell programming uses shell scripts.
  • A shell script contains Linux commands, conditions, and loops.
  • Scripts are saved with .sh extension.

Uses of Shell Programming

  • Automate repetitive tasks
  • File and directory management
  • System administration tasks
  • Backup and monitoring

Example of Shell Script

#!/bin/bash
echo "Hello Linux"
Enter fullscreen mode Exit fullscreen mode

Q12. Write a shell script that checks whether two files are same or not

Below is a simple, exam-friendly shell script that checks whether two files have the same content or not.

Shell Script

#!/bin/bash

# Check if two file names are given
if [ $# -ne 2 ]
then
    echo "Please provide two file names"
    exit 1
fi

# Compare the two files
cmp "$1" "$2" > /dev/null

if [ $? -eq 0 ]
then
    echo "Both files are SAME"
else
    echo "Both files are DIFFERENT"
fi
Enter fullscreen mode Exit fullscreen mode

How this script works (Easy Explanation)

  • $1 and $2 → first and second file name (arguments)
  • cmp → compares two files
  • $? → stores result of last command

    • 0 means files are same
    • non-zero means files are different

How to run the script

  1. Save the file as checkfiles.sh
  2. Give execute permission:
   chmod +x checkfiles.sh
Enter fullscreen mode Exit fullscreen mode
  1. Run the script:
   ./checkfiles.sh file1.txt file2.txt
Enter fullscreen mode Exit fullscreen mode

Output

  • If files are same:
  Both files are SAME
Enter fullscreen mode Exit fullscreen mode
  • If files are different:
  Both files are DIFFERENT
Enter fullscreen mode Exit fullscreen mode

Q14. Write a short note on TCP/IP network and DNS server


TCP/IP Network

TCP/IP stands for Transmission Control Protocol / Internet Protocol.
It is a set of rules (protocols) used to connect computers and transfer data over a network and the Internet.

Explanation (Easy Words)

  • TCP/IP allows computers to send and receive data
  • It breaks data into small packets
  • Each packet is sent separately and reassembled at the destination

Main Functions

  • TCP – Ensures data is sent correctly and completely
  • IP – Handles addressing and routing of data

In short

TCP/IP is the basic communication system of the Internet.


DNS Server

DNS stands for Domain Name System.
A DNS server converts domain names into IP addresses.

Explanation (Easy Words)

  • Humans remember names like google.com
  • Computers understand only IP addresses
  • DNS works like a phone directory of the Internet

Example

google.com → 142.250.195.14
Enter fullscreen mode Exit fullscreen mode

In short

DNS helps users access websites using names instead of numbers.

Q15. Explain Ethernet. How does it help in network connection?


What is Ethernet?

Ethernet is a wired networking technology used to connect computers and devices in a Local Area Network (LAN).

It allows devices such as computers, printers, and switches to communicate with each other using Ethernet cables.


How Ethernet Works (Easy Explanation)

  • Devices are connected using Ethernet cables (RJ45)
  • Data is sent in the form of frames
  • Each device has a unique MAC address
  • Data reaches the correct device using this address

How Ethernet Helps in Network Connection

1. Provides Wired Connection

  • Uses physical cables for connection
  • More stable than wireless networks

2. High Speed Data Transfer

  • Supports fast data transmission
  • Used in offices, colleges, and labs

3. Reliable Communication

  • Less interference compared to Wi-Fi
  • Suitable for continuous data transfer

4. Secure Network

  • Harder to access without physical connection
  • More secure than wireless networks

5. Easy to Set Up

  • Simple connection using cables and switches

Where Ethernet is Used

  • Computer labs
  • Offices
  • Colleges
  • Data centers

Q16. How are users and groups created and managed in Linux?

In Linux, users and groups are used to control access, security, and permissions of files and system resources.

Users in Linux

A user is a person or account that can log in and use the Linux system.

Create a User

useradd username
Enter fullscreen mode Exit fullscreen mode

Set Password for User

passwd username
Enter fullscreen mode Exit fullscreen mode

Delete a User

userdel username
Enter fullscreen mode Exit fullscreen mode

Groups in Linux

A group is a collection of users.
Groups make it easy to assign permissions to multiple users at once.

Create a Group

groupadd groupname
Enter fullscreen mode Exit fullscreen mode

Add User to a Group

usermod -aG groupname username
Enter fullscreen mode Exit fullscreen mode

Delete a Group

groupdel groupname
Enter fullscreen mode Exit fullscreen mode

Managing Users and Groups

View User Information

id username
Enter fullscreen mode Exit fullscreen mode

View All Users

cat /etc/passwd
Enter fullscreen mode Exit fullscreen mode

View All Groups

cat /etc/group
Enter fullscreen mode Exit fullscreen mode

Why Users and Groups Are Important

  • Provide system security
  • Control file and directory access
  • Allow multiuser environment
  • Prevent unauthorized access

Q17. What is the use of Apache Web Server?

Apache Web Server (also called Apache HTTP Server) is a software used to host and deliver websites on the Internet.

It receives requests from users (through a web browser) and sends web pages (HTML, images, CSS, etc.) back to them.

Use of Apache Web Server (Easy Explanation)

1. Host Websites

  • Apache is used to store and display websites.
  • It serves web pages when users enter a website address.

2. Handle Client Requests

  • Accepts requests from browsers like Chrome or Firefox.
  • Sends the correct web content as a response.

3. Support for Multiple Languages

  • Works with HTML, PHP, Python, Perl, etc.
  • Commonly used for dynamic websites.

4. Open Source and Free

  • Free to use and modify.
  • Widely used on Linux servers.

5. Secure and Reliable

  • Supports security features like authentication and access control.
  • Stable and trusted for server use.

Where Apache is Used

  • Web hosting servers
  • College and company websites
  • Localhost testing (localhost)
  • Server-side application deployment

Q18. Write a short note on FTP Server

FTP Server

An FTP Server is a server that uses the FTP (File Transfer Protocol) to transfer files between a client and a server over a network or the Internet.

It allows users to upload files to a server and download files from a server.


Explanation (Easy Words)

  • FTP works on a client–server model
  • A user uses an FTP client (like FileZilla)
  • The FTP server stores files
  • Files can be sent or received using login details (username & password)

Uses of FTP Server

  • Upload website files to a web server
  • Download files from a remote server
  • Share large files
  • Backup and restore data

Features of FTP Server

  • Fast file transfer
  • Supports upload and download
  • Can be password protected
  • Works on Linux and other operating systems

Q19. What is VNC Server?

A VNC Server is a software that allows a user to access and control a computer remotely over a network or the Internet.

VNC stands for Virtual Network Computing.
Using VNC, you can see the desktop screen of another computer and use its keyboard and mouse from a remote location.


Explanation (Easy Words)

  • VNC works on a client–server model
  • The VNC Server runs on the remote computer
  • The VNC Client (Viewer) runs on the user’s computer
  • The screen of the remote system is displayed on the client system

Uses of VNC Server

  • Remote system administration
  • Accessing office computer from home
  • Technical support and troubleshooting
  • Managing servers without physical access

Features of VNC Server

  • Remote desktop access
  • Works on Linux, Windows, and macOS
  • Allows mouse and keyboard control
  • Can be secured with password

Q20. What is DNS?

DNS stands for Domain Name System.

DNS is a system that converts website names (domain names) into IP addresses so that computers can find each other on the Internet.

Explanation (Easy Words)

  • Humans remember names like google.com
  • Computers understand only IP addresses like 142.250.195.14
  • DNS acts like a phone book of the Internet
  • It matches the website name with its correct IP address

Example

www.google.com  →  142.250.195.14
Enter fullscreen mode Exit fullscreen mode

Why DNS is Needed

  • Makes the Internet easy to use
  • No need to remember IP addresses
  • Helps browsers locate the correct server quickly

Q21. Explain ifconfig, netconfig, and netstat

These Linux commands are used to configure and monitor network settings.


1. ifconfig Command

ifconfig stands for interface configuration.
It is used to view and configure network interfaces (like Ethernet, Wi-Fi).

Uses

  • Show IP address
  • Enable or disable network interface
  • Configure network settings

Example

ifconfig
Enter fullscreen mode Exit fullscreen mode

In simple words

ifconfig shows network interface details like IP address and status.


2. netconfig Command

netconfig is used to configure network settings such as:

  • IP address
  • Gateway
  • DNS server

It provides a menu-based or interactive way to set up networking.

Example

netconfig
Enter fullscreen mode Exit fullscreen mode

In simple words

netconfig helps users set up network configuration easily.


3. netstat Command

netstat stands for network statistics.
It is used to display network connections and status.

Uses

  • Show active network connections
  • Display listening ports
  • Check routing table

Example

netstat -an
Enter fullscreen mode Exit fullscreen mode

In simple words

netstat shows network activity and connections.


Difference Between Commands (Easy)

Command Use
ifconfig View/configure network interface
netconfig Configure network settings
netstat Show network connections

Q22. What is FTP Server? How can we install and configure it?

What is FTP Server?

An FTP Server is a server that uses FTP (File Transfer Protocol) to transfer files between a client and a server over a network or the Internet.

It allows users to:

  • Upload files to a server
  • Download files from a server

FTP follows the client–server model.


Uses of FTP Server (Easy)

  • Upload website files to a server
  • Download files from remote systems
  • Share large files
  • Backup and restore data

How to Install FTP Server in Linux (Example: Ubuntu)

Step 1: Update system

sudo apt update
Enter fullscreen mode Exit fullscreen mode

Step 2: Install FTP server (vsftpd)

sudo apt install vsftpd
Enter fullscreen mode Exit fullscreen mode

How to Configure FTP Server

Step 3: Start FTP service

sudo systemctl start vsftpd
Enter fullscreen mode Exit fullscreen mode

Step 4: Enable FTP service at boot

sudo systemctl enable vsftpd
Enter fullscreen mode Exit fullscreen mode

Step 5: Basic Configuration File

The FTP configuration file is:

/etc/vsftpd.conf
Enter fullscreen mode Exit fullscreen mode

Important settings (easy meaning):

  • Enable local users:
local_enable=YES
Enter fullscreen mode Exit fullscreen mode
  • Allow file upload:
write_enable=YES
Enter fullscreen mode Exit fullscreen mode
  • Enable login:
anonymous_enable=NO
Enter fullscreen mode Exit fullscreen mode

After changes, restart FTP:

sudo systemctl restart vsftpd
Enter fullscreen mode Exit fullscreen mode

How to Use FTP Server

  • Use FTP client like FileZilla
  • Login using:

    • Server IP
    • Username
    • Password
    • Port: 21

Q23. Explain Backup and Recovery in Linux


Backup and Recovery in Linux

Backup and Recovery in Linux is the process of saving important data so that it can be restored later if data is lost due to system failure, accidental deletion, or hardware problems.


Backup in Linux

Backup means making a copy of files or data and storing it in a safe place.

Why Backup is Needed

  • Accidental file deletion
  • System crash or hardware failure
  • Virus or malware attack
  • Data corruption

Common Backup Commands

  1. tar – Used to create backup archives
tar -cvf backup.tar /home/user
Enter fullscreen mode Exit fullscreen mode
  1. rsync – Used to copy and sync data
rsync -av /home/user /backup/
Enter fullscreen mode Exit fullscreen mode
  1. cp – Simple file copy
cp file.txt /backup/
Enter fullscreen mode Exit fullscreen mode

In simple words

Backup protects data by keeping a safe copy.


Recovery in Linux

Recovery means restoring data from backup when original data is lost or damaged.

Recovery Example

  • Restore using tar:
tar -xvf backup.tar
Enter fullscreen mode Exit fullscreen mode
  • Restore using rsync:
rsync -av /backup/ /home/user
Enter fullscreen mode Exit fullscreen mode

In simple words

Recovery helps to get back lost data using backup files.


Types of Backup (Brief)

  • Full Backup – Complete data backup
  • Incremental Backup – Only changed files
  • Differential Backup – Changes since last full backup

Top comments (0)