Share
Explore

Linux Final Exam Prep Questions

5 main topics of focus:

What is an OS / What does it do?
What is LINUX / how does it compare with other Operating Systems?
How to interact with LINUX:
Terminal
Scripting (scheduled CRON jobs)
How do secure the LINUX system:
chmod / user, group, WORLD
chmod +777 /httpd
How to do System Level (PYTHON) to issue commands to the Kernel

Based on the "IN3094 Linux Server Administration" course outline, here are 30 short answer questions covering various aspects of Linux server administration:
1. **Introduction to Linux (Module 1)**: What are the primary purposes and key features of an operating system, particularly Linux?
2. **Introduction to Linux (Module 1)**: Describe the origins and development of the Linux operating system.
3. **Linux Installation and Usage (Module 2)**: What are the best practices for installing Fedora Linux?
4. **Linux Installation and Usage (Module 2)**: Explain how to interact with a Linux system using a terminal and basic shell commands.
5. **Linux Network Configuration (Module 3)**: Describe the purpose of TCP/IP protocol and how it is configured in Linux.
6. **Linux Network Configuration (Module 3)**: How do you configure a network interface card (NIC) in Linux?
7. **Common Administrative Tasks (Module 4)**: What are the key aspects of printer, log file, and user administration in Linux?
8. **Exploring Linux Filesystems (Module 5)**: How do you navigate the Linux directory structure using relative and absolute pathnames?
9. **Exploring Linux Filesystems (Module 5)**: Explain the use of shell wildcards in specifying filenames in Linux.
10. **Working with the BASH Shell (Module 6)**: Describe the major features of the BASH shell, including redirection and piping.
11. **Working with the BASH Shell (Module 6)**: How do you create and execute basic shell scripts in Linux?
12. **Linux Server Deployment (Module 7)**: What are the types of hardware typically found in server systems and how are they configured in Linux?
13. **Linux Server Deployment (Module 7)**: Explain the RAID levels and their configurations in Linux.
14. **System Initialization, X-Windows, Localization (Module 8)**: Summarize the major steps necessary to boot a Linux system.
15. **System Initialization, X-Windows, Localization (Module 8)**: How do you configure the system to start and stop daemons at certain run levels or targets?
16. **Linux Filesystem Management (Module 9)**: What is the Filesystem Hierarchy Standard in Linux?
17. **Linux Filesystem Management (Module 9)**: Explain how to manage file and directory permissions in Linux.
18. **Linux Filesystem Administration (Module 10)**: Describe the types of device files in the `/dev` directory.
19. **Linux Filesystem Administration (Module 10)**: How do you mount and unmount filesystems in Linux?
20. **Compression, System Backup, Software Installation (Module 11)**: Outline the features of common compression utilities in Linux.
21. **Compression, System Backup, Software Installation (Module 11)**: Describe the process of installing software packages using the Red Hat Package Manager (RPM).
22. **Managing Linux Processes (Module 12)**: How do you view processes and change their priorities in Linux?
23. **Managing Linux Processes (Module 12)**: Explain the use of `cron` and `at` daemons for scheduling tasks in Linux.
24. **Configuring Network Services (Module 13)**: Describe how to configure key infrastructure services like DHCP and DNS in Linux.
25. **Configuring Network Services (Module 13)**: Explain the process of configuring the Apache Web server for web services in Linux.
26. **Security, Troubleshooting, and Performance (Module 14)**: What are the different facets of Linux security and how can you increase the security of a Linux computer?
27. **Security, Troubleshooting, and Performance (Module 14)**: Describe effective troubleshooting practices for common hardware and software problems in Linux.
28. **General**: Explain the difference between UNIX and Linux operating systems.
29. **General**: What is Logical Volume Management (LVM) in Linux, and what are its advantages?
30. **General**: Discuss the role of systemd in managing services and daemons in Linux.
These questions comprehensively cover the various modules of the course and are designed to test a broad range of knowledge in Linux Server Administration.

Here are detailed answers and explanations for the selected questions:

What are the primary purposes and key features of an operating system, particularly Linux?
Answer: The primary purpose of an operating system (OS) is to manage computer hardware, software resources and user accounts, and provide common services for computer programs. OS acts as an intermediary between application software, users and the computer hardware.
Key features of an OS include managing memory and process allocation, handling input/output operations, and ensuring security and file management.
Linux, specifically, is known for its stability, security, open-source nature, multitasking, and multi-user capabilities.
$$$FREE: many large organizations and governments are moved to LINUX.
It supports a wide range of hardware and software and is highly customizable, making it popular in various applications from desktops to servers and embedded systems.
Describe the origins and development of the Linux operating system.
Answer: Linux originated in 1991 when Linus Torvalds, a student at the University of Helsinki, began developing a free and open-source kernel as a hobby project. Inspired by MINIX, a Unix-like system, and motivated by the desire to have a free operating system, Torvalds released the Linux kernel under the GNU General Public License. The combination of this kernel with the GNU system utilities resulted in the GNU/Linux operating system. Over the years, numerous contributors from around the world have participated in its development, leading to a robust, secure, and efficient OS widely used in various fields.
What are the best practices for installing Fedora Linux?
Answer: When installing Fedora Linux, it is best to:
Check system requirements to ensure compatibility.
Backup existing data to prevent loss.
Create a bootable installation media (USB/DVD) with the Fedora ISO.
Boot the system from the installation media.
Follow the installation guide, selecting appropriate language, time settings, and keyboard layout.
Partition the hard drive carefully, considering separate partitions for /home, /, and swap areas.
Select software packages as per the requirement, keeping minimal for a lightweight installation.
Ensure network connectivity during installation for updates.
Create a user account with a strong password.
Update the system post-installation to get the latest patches and packages.
Explain how to interact with a Linux system using a terminal and basic shell commands.
Answer: Interacting with a Linux system via the terminal involves using text-based commands. Common commands include:
ls: List directory contents.
cd [directory]: Change directory.
pwd: Print working directory.
cp [source] [destination]: Copy files or directories.
mv [source] [destination]: Move/rename files or directories.
rm [file]: Remove files.
mkdir [directory]: Create a new directory.
rmdir [directory]: Remove a directory.
touch [file]: Create a new empty file.
cat [file]: Display file content.
grep [pattern] [file]: Search for a pattern in a file.
echo [text]: Display a line of text.
These commands are executed in a shell, such as Bash, which interprets and processes them, allowing users to perform various tasks like file manipulation, program execution, and system monitoring.
Describe the purpose of TCP/IP protocol and how it is configured in Linux.
Answer: TCP/IP (Transmission Control Protocol/Internet Protocol) is the fundamental suite of protocols for internet and network communication. It facilitates reliable, ordered, and error-checked delivery of data between applications running on hosts in an IP network. To configure TCP/IP in Linux:
Edit network configuration files such as /etc/network/interfaces or use network manager tools.
Assign IP addresses, either statically or through DHCP.
Set the subnet mask and default gateway.
Configure DNS settings, typically in the /etc/resolv.conf file.
Use commands like ifconfig or ip to configure network interfaces.
Restart the network services to apply changes.
How do you configure a network interface card (NIC) in Linux?
Answer: To configure a NIC in Linux:
Identify the interface name using ip link or ifconfig.
Edit the network configuration file (like /etc/network/interfaces or /etc/sysconfig/network-scripts/ifcfg-[interface_name] for Fedora/RHEL).
Set the IP address, netmask, gateway, and DNS servers.
Enable or disable the interface on boot.
Use ifup [interface_name] or ifdown [interface_name] to enable or disable the interface.
Apply changes by restarting the network service or rebooting the system.
What are the key aspects of printer, log file, and user administration in Linux?
Answer:
Printer Administration: Involves setting up and managing printers using tools like CUPS (Common UNIX Printing System). It includes installing printer drivers, configuring network or local printers, and managing print queues and jobs.
Log File Administration: Involves managing system logs, located in /var/log. Key tasks include monitoring log files for errors and issues (like /var/log/syslog or /var/log/messages), configuring log rotation to manage file sizes, and setting log levels.
*** User Administration: Involves creating, managing, and deleting user accounts using commands like useradd, usermod, and userdel. It also includes setting and managing permissions and groups (groupadd, groupmod), and managing user password policies.
*** How do you navigate the Linux directory structure using relative and absolute pathnames?
Answer: In Linux, directories can be navigated using both relative and absolute pathnames:
An absolute pathname starts from the root directory (/) and specifies the complete path to a file or directory. For example, /home/user/documents.
A relative pathname starts from the current directory. For example, documents could be a relative path if the current directory is /home/user.
Use cd [path] to change directories, where [path] can be either a relative or absolute path.
Explain the use of shell wildcards in specifying filenames in Linux.
Answer: Shell wildcards are characters that enable users to select multiple files or directories based on pattern matching. Common wildcards include:
*: Matches any number of characters (e.g., *.txt matches all files with a .txt extension).
?: Matches any single character (e.g., ?.txt matches a.txt, b.txt, but not ab.txt).
[characters]: Matches any one of the enclosed characters (e.g., file[1-3].txt matches file1.txt, file2.txt, and file3.txt).
Describe the major features of the BASH shell, including redirection and piping.
Answer: The BASH (Bourne Again SHell) is a powerful command-line interface in Linux with features like:
Command History: Recalls previous commands.
Scripting: Allows writing scripts to automate tasks.
Aliases: Creates shortcuts for commands.
Tab Completion: Autocompletes commands and filenames.
Redirection: Redirects output of a command to a file (>) or reads input from a file (<).
Piping (|): Sends the output of one command as input to another command, enabling the chaining of commands.
Job Control: Manages foreground and background processes (using fg, bg, &).
Environment Variable Management: Sets and gets variables that affect shell behavior and user environment.

Working with the BASH Shell: Creating and Executing Basic Shell Scripts in Linux
Explanation: A shell script in Linux is a text file containing a series of commands that the shell can execute. To create a basic shell script:
Write the Script: Open a text editor, like nano or vi, and write the commands you want to execute. The first line should be #!/bin/bash to specify the script should be run using the Bash shell.
Save the Script: Save the file with a .sh extension, like myscript.sh.
Make the Script Executable: Run chmod +x myscript.sh to make the script executable.
Execute the Script: Run the script by typing ./myscript.sh in the terminal.
Example: A simple script to list files in the current directory:
bashCopy code
#!/bin/bash echo "Listing files in the directory:" ls
Linux Server Deployment: Hardware in Server Systems and Configuration in Linux
Explanation: Typical server hardware includes CPUs (often multiple for parallel processing), large amounts of RAM for efficient data handling, redundant power supplies for reliability, RAID controllers for data redundancy and performance, and network interfaces for connectivity. In Linux, these components are configured through a combination of BIOS/UEFI settings, kernel modules, and system configuration files.
Example: Configuring a network interface involves editing /etc/network/interfaces or using nmcli (NetworkManager Command Line Interface) for network settings.
Linux Server Deployment: RAID Levels and Configurations in Linux
Explanation: RAID (Redundant Array of Independent Disks) is used to increase data reliability or performance. Common RAID levels include:
RAID 0 (striping) for performance,
RAID 1 (mirroring) for data redundancy,
RAID 5 (striping with parity) for a balance of redundancy and performance.
Linux uses mdadm to create and manage RAID arrays.
Example: Creating a RAID 1 array:
bashCopy code
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
System Initialization, X-Windows, Localization: Major Steps to Boot a Linux System
Explanation: The boot process in Linux involves several steps:
BIOS/UEFI Initialization: Checks hardware and loads the bootloader.
Bootloader (GRUB): Presents kernel options and loads the selected kernel.
Kernel Initialization: Loads drivers, initializes hardware, and mounts the root filesystem.
Init Process: Executes system initialization scripts.
Runlevel/Target Services: Services and daemons are started as per the defined runlevel or systemd target.
Login Prompt: The system is ready for user login.
System Initialization, X-Windows, Localization: Configuring Daemons at Run Levels or Targets
Explanation: Daemons are background services, and their startup is managed by init (SysVinit) or systemd.
SysVinit: Uses runlevels (0-6), each with a different set of daemons. Configuration involves editing scripts in /etc/rc.d or /etc/init.d.
Systemd: Uses 'targets' instead of runlevels. Configuration involves enabling or disabling services using systemctl.
Example: To enable a service at boot with systemd, use systemctl enable [service_name].
Linux Filesystem Management: Filesystem Hierarchy Standard (FHS)
Explanation: The FHS defines the directory structure and directory contents in Linux. Key directories include:
/bin: Essential user command binaries.
/etc: Configuration files.
/home: User home directories.
/usr: Secondary hierarchy for user data.
/var: Variable data like logs and databases.
Linux Filesystem Management: Managing File and Directory Permissions
Explanation: Linux uses a permission model for files and directories. Permissions include read (r), write (w), and execute (x) for the owner, group, and others. Use chmod to change permissions and chown to change ownership.
Example: To give the owner read and write permissions on a file, use chmod u+rw filename.
Linux Filesystem Administration: Device Files in /dev
Explanation: The /dev directory contains device files that represent hardware devices. Types include:
Block Devices: Represent devices like disks (e.g., /dev/sda).
Character Devices: Represent devices that handle data as a stream of bytes, like terminals.
Example: /dev/sda represents the first SATA hard drive.
Linux Filesystem Administration: Mounting and Unmounting Filesystems
Explanation: Mounting attaches a filesystem to a directory, while unmounting detaches it.
Use mount [device] [mount_point] to mount a filesystem.
Use umount [mount_point] to unmount it.
Example: To mount a USB drive, mount /dev/sdb1 /mnt/usb.
Compression, System Backup, Software Installation: Features of Common Compression Utilities
Explanation: Linux provides various compression tools, such as:
gzip: Compresses files, typically used for log files.
bzip2: Offers better compression than gzip at the cost of speed.
tar: Combines multiple files into one archive, often used with gzip or bzip2.
Example: To compress a directory using tar and gzip, tar czvf archive.tar.gz /path/to/directory.

Managing Linux Processes: Viewing Processes and Changing Their Priorities
Explanation: In Linux, you can view processes using commands like ps, top, or htop. These tools display information about running processes, including their ID, CPU usage, memory usage, and running time. To change a process's priority, use the nice and renice commands. nice sets the priority for a new process, while renice changes the priority of an existing process. The priority level ranges from -20 (highest priority) to 19 (lowest priority).
Example: To change the priority of a running process with ID 1234 to a lower priority: renice 10 -p 1234.
Managing Linux Processes: Using cron and at for Scheduling Tasks
Explanation:
Cron: Used for scheduling recurring tasks. Cron jobs are defined in crontab files with a specific syntax to indicate when the task should run. Each user can have their own crontab.
At: Used for scheduling a one-time task at a specific time. Once the task is executed, the schedule is not repeated.
Example:
Cron: To run a backup script every day at 1 AM, edit the crontab with crontab -e and add: 0 1 * * * /path/to/backup_script.sh.
At: To run a script at 4 PM, use: echo "/path/to/script.sh" | at 16:00.
Configuring Network Services: DHCP and DNS Configuration
Explanation:
DHCP (Dynamic Host Configuration Protocol): Assigns IP addresses dynamically to clients on the network. In Linux, DHCP server configuration is typically managed in the /etc/dhcp/dhcpd.conf file.
DNS (Domain Name System): Translates domain names into IP addresses. DNS server settings in Linux are usually configured in the /etc/resolv.conf file or through network manager tools.
Example:
DHCP: Define a range of IP addresses to be assigned in dhcpd.conf: range 192.168.1.10 192.168.1.100;.
DNS: Set a DNS server in resolv.conf: nameserver 8.8.8.8.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.