| |

LFCA 125 🐧 LFCA Practice Questions — Domain 2

Domain 2, Linux Fundamentals, is 16% of the LFCA exam—roughly 10 questions. It covers the Linux operating system itself: distributions and their package managers, the Filesystem Hierarchy Standard, open source licensing, and the command line. These are the questions that test whether you understand how Linux is organized, not just how to run commands.

This chapter is a set of practice questions in the style of the LFCA exam. Each question presents a scenario and asks for the best answer among four choices. The answers are explained, and the distractors are identified so you can see why the wrong answers are wrong. The questions cover the specific competencies in Domain 2: distributions, package managers, the FHS, licensing, and basic command-line operations.

Key point: Domain 2 is about fundamentals, not administration. It tests whether you know which distribution uses which package manager, what each directory in the filesystem hierarchy is for, and how open source licenses differ. The command-line questions test basic navigation and file operations, not advanced scripting.


Why Domain 2 matters

The foundation problem. Everything else in the LFCA builds on Linux Fundamentals. If you do not know what /etc is for, you cannot troubleshoot a configuration problem. If you do not know that Ubuntu uses apt, you cannot install a package in a scenario question. Domain 2 is the vocabulary of Linux.

The distribution problem. Linux is not one operating system. It is a family of distributions, each with its own package manager, release cycle, and target audience. The exam expects you to know the major families: Debian-based (Ubuntu, Debian), Red Hat-based (RHEL, Fedora, CentOS, Rocky), SUSE-based (openSUSE, SLES), and Arch-based (Arch, Manjaro). Each family has its own package management tooling.

The filesystem problem. The Filesystem Hierarchy Standard defines where things go. Configuration in /etc, logs and variable data in /var, user home directories in /home, temporary files in /tmp, binaries in /usr/bin and /usr/local/bin, virtual process files in /proc. The exam tests whether you know the purpose of each major directory.

The licensing problem. Open source is not one thing. GPL is copyleft: derivatives must be released under the same license. MIT, Apache 2.0, and BSD are permissive: they allow proprietary use and do not require source disclosure. The exam tests the distinction and its practical implications.

The command problem. The command-line questions test basic commands: ls, cd, cp, mv, rm, mkdir, cat, grep, find, and I/O redirection. These are not advanced. They are the commands every Linux user knows.


a. Linux Operating System questions

Question 1. Which package manager is used by Ubuntu and Debian-based distributions?

A. dnf
B. apt
C. zypper
D. pacman

Answer: B. Ubuntu and Debian use apt (Advanced Package Tool) with the underlying dpkg package format. Option A, dnf, is used by Red Hat-based distributions. Option C, zypper, is used by SUSE. Option D, pacman, is used by Arch Linux.


Question 2. Which directory in the Filesystem Hierarchy Standard contains configuration files?

A. /var
B. /etc
C. /usr
D. /tmp

Answer: B. The /etc directory contains system-wide configuration files. Most configuration changes on a Linux system involve editing files in /etc. Option A, /var, contains variable data such as logs, spools, and databases. Option C, /usr, contains the operating system’s userland programs and libraries. Option D, /tmp, contains temporary files.


Question 3. Where are log files typically stored according to the Filesystem Hierarchy Standard?

A. /etc/log
B. /var/log
C. /usr/log
D. /home/log

Answer: B. Log files are variable data that grows over time, so they belong in /var. The /var/log directory is the standard location for system and application logs. Option A is not a standard path. Option C is not a standard path. Option D would put logs in a user’s home directory, which is not where system logs go.


Question 4. Which license requires that derivative works be released under the same license?

A. MIT
B. Apache 2.0
C. GPL
D. BSD

Answer: C. The GNU General Public License (GPL) is a copyleft license. It requires that derivative works be distributed under the same license and that the source code be made available. Options A, B, and D are permissive licenses. They allow the software to be used in proprietary products and do not require source disclosure of derivatives.


Question 5. Which of the following is a permissive open source license?

A. GPLv3
B. AGPL
C. MIT
D. LGPL

Answer: C. The MIT license is permissive. It allows users to do almost anything with the software, including using it in proprietary products, as long as the original copyright notice is included. Options A, B, and D are copyleft licenses with varying obligations. GPLv3 and AGPL require source disclosure of derivatives; LGPL is a weaker copyleft that applies to the library itself but permits proprietary software to link against it.


Question 6. Which directory contains the home directories of regular users?

A. /root
B. /home
C. /users
D. /opt

Answer: B. The /home directory contains the home directories of regular users. Each user typically has a directory like /home/jsmith. Option A, /root, is the home directory of the root user, not of regular users. Option C is not a standard path. Option D, /opt, is for optional software packages.


Question 7. What is the purpose of the /proc directory?

A. Store process logs
B. Provide a virtual filesystem with process and kernel information
C. Store temporary files created by processes
D. Store user home directories

Answer: B. The /proc directory is a virtual filesystem that provides information about running processes and the kernel. Files like /proc/cpuinfo and /proc/meminfo are generated on the fly by the kernel and do not exist on disk. Option A is incorrect—process logs are typically in /var/log. Option C describes /tmp. Option D describes /home.


Question 8. Which distribution family uses dnf as its package manager?

A. Debian
B. Red Hat
C. SUSE
D. Arch

Answer: B. Red Hat-based distributions—RHEL, Fedora, CentOS, Rocky Linux, AlmaLinux—use dnf (DNF, the successor to yum). Option A, Debian, uses apt. Option C, SUSE, uses zypper. Option D, Arch, uses pacman.


Question 9. What does the command ls -la do?

A. Lists only hidden files
B. Lists all files with long format and shows hidden files
C. Lists files with sizes in human-readable format
D. Lists files sorted by modification time

Answer: B. The -l flag uses long format, showing permissions, ownership, size, and modification time. The -a flag shows all files, including hidden files that begin with a dot. Option A is incorrect—-a shows hidden files in addition to regular ones. Option C describes -h, which requires -l to be present for human-readable sizes. Option D describes -t.


Question 10. Which command is used to search for a pattern in a file?

A. find
B. grep
C. locate
D. which

Answer: B. The grep command searches for text patterns in files. It is used to filter output, search logs, and find lines that match a regular expression. Option A, find, searches the filesystem for files that match criteria like name, size, or modification time—not for text patterns within files. Option C, locate, searches a database of filenames. Option D, which, locates the executable file for a command.


Question 11. Which command appends text to a file without overwriting its existing contents?

A. >
B. >>
C. |
D. <

Answer: B. The >> operator appends output to a file. If the file exists, the new output is added to the end. Option A, >, redirects output to a file but overwrites its contents. Option C, |, pipes output from one command to another. Option D, <, redirects input from a file to a command.


Question 12. Where are user-installed binaries typically placed?

A. /bin
B. /usr/bin
C. /usr/local/bin
D. /sbin

Answer: C. The /usr/local/bin directory is the standard location for locally installed binaries that are not part of the distribution’s package management. Option A, /bin, contains essential system binaries that are part of the base system. Option B, /usr/bin, contains binaries installed by the distribution’s packages. Option D, /sbin, contains system administration binaries.


Question 13. Which of the following is a characteristic of the Apache 2.0 license?

A. It requires derivative works to use the same license
B. It includes an express grant of patent rights
C. It prohibits commercial use
D. It requires source code to be published

Answer: B. The Apache 2.0 license includes an express grant of patent rights from contributors to users. This distinguishes it from the MIT license, which is silent on patents. Option A describes a copyleft license like the GPL. Option C is incorrect—Apache 2.0 permits commercial use. Option D is incorrect—Apache 2.0 is permissive and does not require source disclosure of derivatives.


Question 14. What is the difference between cp and mv?

A. cp copies files, mv moves or renames files
B. cp moves files, mv copies files
C. Both do the same thing
D. cp works only on directories, mv works only on files

Answer: A. The cp command copies files, creating a new file at the destination while leaving the original in place. The mv command moves files, removing the original from its source location and placing it at the destination. If the source and destination are in the same directory, mv renames the file. Option B is the reverse. Option C is incorrect. Option D is incorrect—both commands work on files and directories.


Question 15. Which command creates a new directory?

A. touch
B. mkdir
C. rmdir
D. ln

Answer: B. The mkdir command creates a new directory. Option A, touch, creates an empty file or updates the modification time of an existing file. Option C, rmdir, removes an empty directory. Option D, ln, creates a link to a file.


Complete Example Session

# ============================================
# PART 1: PACKAGE MANAGERS
# ============================================
Ubuntu/Debian  → apt (dpkg)
RHEL/Fedora    → dnf (rpm)
SUSE           → zypper
Arch           → pacman

# ============================================
# PART 2: FILESYSTEM HIERARCHY
# ============================================
/etc     → configuration files
/var     → variable data (logs, spools)
/home    → user home directories
/tmp     → temporary files
/usr     → userland programs and libraries
/proc    → virtual process and kernel filesystem

# ============================================
# PART 3: LICENSES
# ============================================
GPL       → copyleft, derivatives must be GPL
AGPL      → copyleft, network use triggers disclosure
LGPL      → weak copyleft, library linking permitted
MIT       → permissive, minimal obligations
Apache 2.0 → permissive, patent grant
BSD       → permissive, minimal obligations

# ============================================
# PART 4: COMMAND LINE
# ============================================
ls -la              → list all files, long format
cd /etc             → change to /etc
cp file1 file2      → copy file
mv file1 file2      → move or rename file
mkdir newdir        → create directory
grep pattern file   → search for pattern
find /var -mtime -1 → files modified in last day
echo "text" >> file → append to file

The four parts summarized the command patterns tested in Domain 2: package managers, filesystem hierarchy, licenses, and command-line operations.


Quick Reference

Package Managers by Distribution

DistributionPackage ManagerPackage Format
Ubuntu, Debianapt.deb
RHEL, Fedora, Rockydnf.rpm
SUSEzypper.rpm
Archpacman.pkg.tar.zst
Alpineapk.apk

Filesystem Hierarchy

DirectoryPurpose
/Root of the filesystem
/binEssential user binaries
/sbinSystem administration binaries
/etcConfiguration files
/homeUser home directories
/rootRoot user’s home directory
/varVariable data (logs, spools, databases)
/tmpTemporary files
/usrUserland programs and libraries
/usr/localLocally installed software
/optOptional software packages
/procVirtual process and kernel filesystem
/devDevice files
/mntMount point for temporary mounts
/mediaMount point for removable media

Open Source Licenses

LicenseTypeKey Obligation
MITPermissiveInclude copyright notice
BSDPermissiveInclude copyright notice
Apache 2.0PermissiveInclude notice, patent grant
GPLCopyleftDerivatives must be GPL
AGPLCopyleftNetwork use triggers disclosure
LGPLWeak copyleftLibrary linking permitted

Basic Commands

CommandPurpose
lsList directory contents
cdChange directory
cpCopy files
mvMove or rename files
rmRemove files
mkdirCreate directory
catDisplay file contents
grepSearch for patterns
findSearch for files
touchCreate empty file

Best Practices

✅ Do This:

# Know which package manager belongs to which distribution
Ubuntu → apt, RHEL → dnf                               # ✅

# Know the purpose of major directories
/etc config, /var logs, /home users                     # ✅

# Distinguish copyleft from permissive licenses
GPL = copyleft, MIT = permissive                        # ✅

# Use >> to append, > to overwrite
echo "line" >> file                                     # ✅

# Use grep for text search, find for file search
grep error /var/log/syslog                              # ✅
find /var/log -mtime -1                                 # ✅

❌ Don’t Do This:

# Don't confuse package managers
apt install on RHEL  → wrong tool                       # ❌

# Don't confuse /etc and /var
Logs are not in /etc                                    # ❌

# Don't assume all open source licenses are the same
MIT ≠ GPL                                               # ❌

# Don't use > when you mean >>
> overwrites, >> appends                                 # ❌

# Don't use find when you mean grep
find searches files, grep searches content              # ❌

Common Pitfalls

PitfallWhy It HappensFix
Wrong package managerAssuming all Linux is the sameMatch manager to distribution
Logs in /etcConfusing config with dataLogs are in /var/log
Confusing cp and mvBoth move datacp copies, mv moves
> overwritesMissing one >Use >> to append
find vs grepBoth searchfind for files, grep for content
License confusionTreating all OSS as equivalentCopyleft ≠ permissive

Real-World Examples

1. Install a Package

# Ubuntu
sudo apt install nginx

# RHEL
sudo dnf install nginx

2. Check Configuration

ls -la /etc/nginx/
cat /etc/nginx/nginx.conf

3. Check Logs

tail -f /var/log/syslog
grep error /var/log/nginx/error.log

4. Find Files

find /var/log -name "*.log" -mtime -7

5. Search Content

grep -r "error" /var/log/

6. Append to File

echo "new entry" >> /tmp/notes.txt

7. Copy and Move

cp /etc/nginx/nginx.conf /tmp/nginx.conf.bak
mv /tmp/nginx.conf.bak /home/user/backups/

8. Create Directory

mkdir -p /srv/www/mysite

9. Check License

cat /usr/share/doc/package/copyright

10. List Files

ls -la /etc/

Visual

Distribution Families

┌─────────────────────────────────────────────────────────────┐
│  LINUX DISTRIBUTION FAMILIES                                │
│                                                             │
│  ┌─────────────────────────────────────────────────────┐    │
│  │  DEBIAN FAMILY                                      │    │
│  │  Debian, Ubuntu, Mint, Pop!_OS                      │    │
│  │  Package manager: apt / dpkg                        │    │
│  │  Package format: .deb                               │    │
│  └─────────────────────────────────────────────────────┘    │
│                                                             │
│  ┌─────────────────────────────────────────────────────┐    │
│  │  RED HAT FAMILY                                     │    │
│  │  RHEL, Fedora, CentOS, Rocky, AlmaLinux             │    │
│  │  Package manager: dnf / rpm                         │    │
│  │  Package format: .rpm                               │    │
│  └─────────────────────────────────────────────────────┘    │
│                                                             │
│  ┌─────────────────────────────────────────────────────┐    │
│  │  SUSE FAMILY                                        │    │
│  │  openSUSE, SLES                                     │    │
│  │  Package manager: zypper / rpm                      │    │
│  └─────────────────────────────────────────────────────┘    │
│                                                             │
│  ┌─────────────────────────────────────────────────────┐    │
│  │  ARCH FAMILY                                        │    │
│  │  Arch, Manjaro, EndeavourOS                         │    │
│  │  Package manager: pacman                            │    │
│  └─────────────────────────────────────────────────────┘    │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Filesystem Hierarchy

┌─────────────────────────────────────────────────────────────┐
│  FILESYSTEM HIERARCHY                                       │
│                                                             │
│  /                                                          │
│  ├── bin/          essential binaries                       │
│  ├── sbin/         system binaries                          │
│  ├── etc/          configuration files                      │
│  ├── home/         user home directories                    │
│  │   └── jsmith/                                            │
│  ├── root/         root user's home                         │
│  ├── var/          variable data                            │
│  │   ├── log/      log files                                │
│  │   └── spool/    print and mail spools                    │
│  ├── tmp/          temporary files                          │
│  ├── usr/          userland programs                        │
│  │   ├── bin/      user binaries                            │
│  │   ├── lib/      libraries                                │
│  │   └── local/    locally installed software               │
│  ├── opt/          optional software                        │
│  ├── proc/         virtual process filesystem               │
│  ├── dev/          device files                             │
│  └── mnt/          temporary mount points                   │
│                                                             │
└─────────────────────────────────────────────────────────────┘

License Spectrum

┌─────────────────────────────────────────────────────────────┐
│  LICENSE SPECTRUM                                           │
│                                                             │
│  PERMISSIVE ◀──────────────────────────────▶ COPYLEFT       │
│                                                             │
│  MIT    BSD    Apache 2.0    LGPL    GPL    AGPL            │
│                                                             │
│  ◀── Fewer obligations           More obligations ──▶       │
│                                                             │
│  MIT: do anything, keep notice                              │
│  BSD: do anything, keep notice                              │
│  Apache 2.0: permissive + patent grant                      │
│  LGPL: library can be linked by proprietary code            │
│  GPL: derivatives must be GPL                               │
│  AGPL: GPL + network use triggers disclosure                │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Command Comparison

┌─────────────────────────────────────────────────────────────┐
│  cp vs mv                                                   │
│                                                             │
│  cp file1 file2                                             │
│  ┌─────────┐         ┌─────────┐                            │
│  │ file1   │ ──────▶ │ file2   │                            │
│  └─────────┘         └─────────┘                            │
│  Both exist. Original is preserved.                         │
│                                                             │
│  mv file1 file2                                             │
│  ┌─────────┐         ┌─────────┐                            │
│  │ file1   │ ──────▶ │ file2   │                            │
│  └─────────┘         └─────────┘                            │
│  Only file2 exists. Original is gone.                       │
│                                                             │
├─────────────────────────────────────────────────────────────┤
│  grep vs find                                               │
│                                                             │
│  grep pattern file     → searches INSIDE files for text     │
│  find /path -name "x"  → searches filesystem for files      │
│                                                             │
├─────────────────────────────────────────────────────────────┤
│  > vs >>                                                    │
│                                                             │
│  echo "line" > file    → overwrites file                    │
│  echo "line" >> file   → appends to file                    │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Summary

TopicKey Fact
Ubuntu/Debianapt
RHEL/Fedoradnf
SUSEzypper
Archpacman
Config files/etc
Log files/var/log
User homes/home
Temporary files/tmp
Virtual process FS/proc
Permissive licenseMIT, BSD, Apache 2.0
Copyleft licenseGPL, AGPL, LGPL
Copy filescp
Move filesmv
Search contentgrep
Search filesfind
Append output>>

Key takeaways:

  • Package managers are distribution-specific. Ubuntu and Debian use apt. RHEL, Fedora, and their derivatives use dnf. SUSE uses zypper. Arch uses pacman. The exam tests whether you know which manager belongs to which family.
  • The Filesystem Hierarchy Standard defines where things go. Configuration in /etc, logs and variable data in /var, user homes in /home, temporary files in /tmp, locally installed software in /usr/local, and the virtual process filesystem in /proc.
  • Open source licenses differ in their obligations. GPL is copyleft and requires derivatives to be GPL. MIT and BSD are permissive and require only that the copyright notice be preserved. Apache 2.0 is permissive and adds a patent grant. AGPL extends GPL to network use.
  • The command line is the foundation. ls, cd, cp, mv, rm, mkdir, cat, grep, find, and I/O redirection are the basic tools. The exam tests whether you know what each command does and when to use it.
  • cp copies, mv moves. After cp, both files exist. After mv, only the destination exists. This distinction appears in scenarios about backups, renames, and file organization.
  • grep searches content, find searches files. grep finds text patterns inside files. find finds files by name, size, modification time, or other metadata. Confusing them is a common error.
  • > overwrites, >> appends. The single angle bracket replaces the file’s contents. The double angle bracket adds to the end. Choosing the wrong one destroys data or fails to add it.

Remember: Domain 2 is about the fundamentals of Linux. It tests vocabulary—which distribution uses which package manager, what each directory is for, how licenses differ—and basic command-line operations. The questions are not deep. They are broad. If you have used Linux, the answers are often intuitive. If you have only read about it, practice in a shell: create a file, copy it, move it, search for text inside it, find it by name, check its permissions. The commands are the vocabulary, and the vocabulary is what the exam tests.



Stop using slow, ad-bloated tool sites! 🤮

🔎 Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
✅ Finance (Mortgage, Interest, Inflation)
✅ Tech (Base64, JSON, Dev Suite, IP)
✅ Health (BMI, BMR, TDEE)
✅ Productivity (Timer, Workspace, QR)

⚡️ Fast & Private
🔒 No data leaves your device
💎 100% Free

🔗 Use it now: https://tools.kandz.me
🔖 Bookmark it—you’ll need it later!