---
title: "Linux: System Administration Fundamentals"
description: "Test your knowledge of Linux fundamentals with this comprehensive quiz covering essential commands, file system navigation, permissions, process management, package managers, and Linux administration best practices."
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/quizzes/post/linux-system-administration-fundamentals-quiz
---

# Linux: System Administration Fundamentals

Welcome to the Linux Basics Quiz! This quiz is designed to test your understanding of fundamental Linux concepts, commands, and system administration best practices. Each question is multiple-choice, and you'll find hints to help you along the way. Good luck!

## Questions

### 1. Which command is used to display the current working directory?

- `dir`
  - Lists directory contents in many shells but does not output the path string of the current location.
- **`pwd`** ✅
  - Stands for Print Working Directory and outputs the absolute path from the root to your current location.
- `lpwd` 
  - Often used in FTP clients to show a local directory, but it is not a standard standalone Linux command.
- `path`
  - Typically refers to an environment variable ($PATH) used to locate binaries rather than a directory command.

**Hint:** Think: "Print Working Directory".

### 2. Which symbol represents the current user’s home directory?

- `/`
  - The forward slash represents the system root, the highest level possible in the file system hierarchy.
- **`~`** ✅
  - The tilde is a shell shortcut that expands to the specific path of the currently logged-in user.
- `.`
  - A single period represents the current directory you are in, regardless of its location on the disk.
- `#`
  - Often denotes the root user prompt or a comment in a script rather than a directory shorthand.

**Hint:** It is the wavy character (~).

### 3. What does the command "chmod 777 file.txt" do?

- Sets the file to read-only for all system users
  - Read-only access for everyone would be represented by the numeric mode 444.
- **Grants read, write, and execute rights to everyone** ✅
  - Assigns full permissions to the owner, the group, and all others by combining 4, 2, and 1.
- Changes the ownership of the file to the root user
  - Ownership changes require the chown command; chmod only modifies the access permission bits.
- Makes the file invisible within standard listings
  - Visibility is managed by prefixing a filename with a dot, not through the permission system.

**Hint:** 7 is the sum of Read (4), Write (2), and Execute (1).

### 4. Which command is used to view the contents of a file without opening an editor?

- `ls`
  - Displays the names of files and folders but cannot read the internal data of a specific file.
- **`cat`** ✅
  - Outputs the entire content of a file directly to the terminal window in a single stream.
- `grep`
  - Used for searching patterns within text; while it reads files, its primary role is filtering.
- `touch` 
  - Used to create new empty files or update timestamps, but it does not display file data.

**Hint:** Think: "Concatenate".

### 5. What is the "Root" user in Linux?

- A system account used for basic guest access
  - Guest accounts are highly restricted; the Root user is the opposite of a restricted account.
- **The superuser account with unrestricted system access** ✅
  - The administrative master of the system, capable of overriding all file permissions and settings.
- The first user created during the OS installation
  - The first created user often has sudo rights, but Root is a built-in account present by default.
- The default directory where all user data is stored
  - This refers to /home; Root can refer to the / directory or the superuser, but not the user home base.

**Hint:** The account with UID 0.

### 6. Which command allows a user to run a command with superuser privileges?

- `sh` 
  - Invokes the standard shell interpreter but does not elevate privileges to the superuser level.
- **`sudo`** ✅
  - Executes a single command as root if the user is authorized within the system sudoers configuration.
- `su`
  - Switches the current session to another user account entirely rather than running a single command.
- `run` 
  - Not a standard Linux command for privilege escalation; it is often used as a verb in other tools.

**Hint:** "Substitute User Do".

### 7. Where are system-wide configuration files usually stored?

- `/bin`
  - Contains essential binary executables like ls and bash rather than text-based configurations.
- **`/etc`** ✅
  - The standard directory for system-wide configuration files and subdirectories for installed services.
- `/var`
  - Reserved for variable data such as logs and databases that change frequently during operation.
- `/usr`
  - Contains user-related programs and libraries, but generally not the primary system configurations.

**Hint:** Think: "Editable Text Configuration".

### 8. Which command lists all currently running processes?

- `proc`
  - The /proc directory is a virtual filesystem containing data, but it is not a standalone command.
- **`ps`** ✅
  - Provides a snapshot of current processes; common flags like "aux" or "-ef" show system-wide data.
- `list` 
  - Not a standard command for process management; list functions are usually handled by ls or ps.
- `jobs`
  - Only displays background processes started within the current shell session, not system-wide tasks.

**Hint:** Short for "Process Status".

### 9. What does the "grep" command do?

- Compresses files into a single archive
  - Compression is handled by tar, gzip, or zip; grep is strictly for text search and filtering.
- **Searches for a specific pattern within text** ✅
  - Filters input or searches files for lines that match a specific string or regular expression.
- Calculates the total size of a directory
  - Disk usage calculation is performed by the du command, not by text processing tools like grep.
- Displays summary of system hardware
  - Hardware information is retrieved via lscpu or lshw; grep can filter that output but not generate it.

**Hint:** Global Regular Expression Print.

### 10. Which command is used to remove a directory and all its contents?

- `rmdir`
  - A safety-focused utility that only removes directories if they are already completely empty.
- **`rm -rf`** ✅
  - Uses the recursive flag to enter subfolders and the force flag to ignore prompts and errors.
- `del /s`
  - This is the command syntax used in Windows environments; Linux uses rm for all file deletions.
- `wipe` 
  - A specialized tool for secure file deletion, but not the standard command for removing directories.

**Hint:** Requires "recursive" and "force" flags.

### 11. What is a "Man Page"?

- A specialized script for user setup
  - User environments are set up via profile scripts; man pages are for reference documentation.
- **The built-in documentation for commands** ✅
  - The standard manual system accessed via the man command to view usage, flags, and examples.
- A utility to monitor system memory
  - Memory is monitored using top, free, or vmstat; man is used exclusively for reading manuals.
- A text-mode interface for web browsing
  - Text browsers include lynx or w3m; man pages are documentation files stored on the local disk.

**Hint:** The primary source of Linux help.

### 12. Which command is used to change the owner of a file?

- `chmod`
  - Modifies the access permissions (mode) of a file but does not alter the actual user ownership.
- **`chown`** ✅
  - The Change Owner command is used to assign a file or directory to a different user and group.
- `chgrp`
  - Specifically used to change the group association of a file, but it cannot change the user owner.
- `set` 
  - Used to configure shell options and environment variables rather than filesystem ownership.

**Hint:** Change Owner.

### 13. What does the "|" (pipe) operator do?

- Merges two files into a single document
  - Merging files is usually done with cat or redirection; the pipe chains the execution of commands.
- **Sends one command’s output to another** ✅
  - Allows for the output of one process to be used as the direct input for the following process.
- Terminates a process running in background
  - Ending processes requires the kill command; pipes are for data redirection between active tools.
- Generates a temporary backup of a file
  - Backup creation is handled by cp or rsync; pipes do not involve file duplication or storage.

**Hint:** Connecting the output of A to the input of B.

### 14. Which package manager is native to Debian-based systems?

- `yum` 
  - The Yellowdog Updater, Modified (yum) is the legacy manager for Red Hat and CentOS systems.
- **`apt` ** ✅
  - The Advanced Package Tool (apt) is the standard high-level interface for Debian and Ubuntu.
- `dnf` 
  - The modern successor to yum used in Fedora and RHEL; it is not native to Debian-based OS.
- `rpm` 
  - A low-level package format and tool for Red Hat; Debian uses the .deb format and dpkg/apt.

**Hint:** Advanced Package Tool.

### 15. What does "df -h" show?

- The list of currently open files
  - Open files are tracked using the lsof command; df is used for filesystem storage statistics.
- **Available space on mounted filesystems** ✅
  - Reports the amount of disk space used and available on all currently mounted partitions.
- The total size of a specific file
  - Individual file attributes are checked with ls or stat; df looks at the entire disk or volume.
- Active network interface statistics
  - Networking data is retrieved via ip, ifconfig, or netstat; df does not monitor network traffic.

**Hint:** Disk Free - Human Readable.

### 16. Which character overwrites a file with command output?

- `>>`
  - Double arrows are used for appending; they add data to the end of a file without erasing it.
- **`>`** ✅
  - A single arrow redirects the output and completely replaces any existing content in the file.
- `<`
  - Used for input redirection; it feeds the content of a file into a command as standard input.
- `&`
  - Used to execute a command in the background, allowing the user to continue using the shell.

**Hint:** Standard output redirection.

### 17. What is "systemd"?

- A kernel module for disk management
  - Systemd is a user-space suite that runs on top of the kernel; it is not a kernel module itself.
- **The primary system and service manager** ✅
  - The init system (PID 1) responsible for bootstrapping user space and managing system services.
- A tool for managing network firewalls
  - Firewall rules are managed via iptables or firewalld; systemd handles process orchestration.
- A protocol for remote file sharing
  - File sharing protocols include NFS or SMB; systemd is focused on local service management.

**Hint:** The modern init system.

### 18. How do you see the last 10 lines of a file?

- `last`
  - Displays a list of the most recent users who logged into the system rather than file content.
- **`tail`** ✅
  - Outputs the final part of a file; it is commonly used with "-f" to monitor logs in real-time.
- `end` 
  - Not a standard Linux command for reading files; tail is the universal tool for this purpose.
- `less`
  - A pager used to navigate through a whole file; it does not jump to the end by default.

**Hint:** Think of the end of an animal.

### 19. What is the purpose of the /tmp directory?

- Stores sensitive user password data
  - Authentication data is kept in secure files like /etc/shadow, not in the world-writable /tmp.
- **Holds temporary files cleared at boot** ✅
  - A volatile storage area where applications and users can store data that is not needed long-term.
- Contains permanent system binaries
  - Persistent software and system tools live in /usr/bin or /bin, which are not cleared on reboot.
- Keeps network configuration backups
  - System configurations are stored in /etc; /tmp is strictly for non-persistent, temporary data.

**Hint:** Files here usually vanish after a reboot.

### 20. How do you kill a process if you know its ID?

- `stop`
  - Commonly used in service managers like systemctl, but not used to signal a process ID directly.
- **`kill`** ✅
  - Sends a specific signal (defaulting to SIGTERM) to a process to request its termination.
- `exit`
  - Used to close the current shell session or script execution rather than stopping other processes.
- `end` 
  - Not a standard command for process control; signals must be sent via kill or pkill.

**Hint:** Sends a signal (TERM or KILL).

### 21. Which command searches for files by name or size?

- `locate`
  - Uses a pre-built database for speed, but "find" is the standard for live, attribute-based searches.
- **`find`** ✅
  - The primary tool for walking a file hierarchy to find files based on name, size, or timestamp.
- `where` 
  - Often a shell builtin in Zsh or used in Windows, but "find" is the POSIX standard for file search.
- `grep` 
  - Searches for text inside of files rather than searching for the file objects themselves.

**Hint:** Searches the live filesystem tree.

### 22. What is a "Shebang" ( #! )?

- A comment line ignored by the shell
  - While it starts with #, it is a special sequence used by the kernel to locate an interpreter.
- **A line specifying the script interpreter** ✅
  - Tells the system which program (like bash or python) should be used to execute the script.
- A flag to enable script optimization
  - Does not affect execution speed; its only purpose is to define the execution environment.
- A permission that allows execution
  - Execution permissions are set by the filesystem via chmod; the shebang defines the handler.

**Hint:** The very first line of a script.

### 23. Where is local user group information stored?

- `/etc/passwd`
  - Contains individual user account details like UID and home path, but not group definitions.
- **`/etc/group` ** ✅
  - The text file that defines system groups, their GIDs, and their respective member lists.
- `/etc/shadow`
  - Used exclusively for storing encrypted password hashes to protect user credentials.
- `/etc/config`
  - Not a standard file for user management; group data is strictly maintained in /etc/group.

**Hint:** Found in the /etc directory.

### 24. What is a "Symbolic Link" (Soft Link)?

- A full copy of the original file data
  - A copy is a separate file; a symbolic link is merely a pointer to the original location.
- **A pointer to another file or directory** ✅
  - A special file type that contains the path to another object; it breaks if the target is moved.
- A hidden version of a system binary
  - Links are not inherently hidden and serve as references rather than security masking tools.
- A backup file used for system recovery
  - Recovery files are distinct copies; symbolic links offer no data redundancy if the source is lost.

**Hint:** Like a shortcut in Windows.

### 25. Which command shows the manual for a command?

- `help` 
  - Provides documentation for shell built-in commands but not for standalone system binaries.
- **`man`  ** ✅
  - Opens the system manual interface to show detailed syntax, flags, and descriptions for tools.
- `info` 
  - A secondary documentation format that provides hyperlinked manuals, but "man" is the primary standard.
- `show` 
  - Not a standard command for viewing documentation; manuals are strictly accessed via man or info.

**Hint:** Manual.

### 26. What does the /dev directory contain?

- Source code for local development
  - Source code is kept in /usr/src or user homes; /dev is reserved for system hardware interfaces.
- **Files representing hardware devices** ✅
  - Contains nodes that the OS uses to communicate with physical hardware like disks and terminals.
- Developer tools like the GCC compiler
  - Compilers are binary applications stored in /usr/bin rather than the device directory.
- User-specific desktop configuration
  - Desktop settings are stored in hidden user directories; /dev handles hardware interaction.

**Hint:** Everything is a file.

### 27. How do you view hidden files?

- `ls -h`
  - The -h flag makes file sizes human-readable (KB, MB) but does not show hidden files.
- **`ls -a`** ✅
  - The "All" flag includes entries starting with a dot, which the shell hides during normal listing.
- `ls -l`
  - Provides a long listing format with details but still excludes hidden files unless "-a" is added.
- `ls -s`
  - Displays the size of files in blocks but does not reveal files hidden by the naming convention.

**Hint:** Show "All".

### 28. Which command provides an interactive process list?

- `ps`  
  - Displays a static snapshot of processes that does not update automatically after execution.
- **`top` ** ✅
  - Provides a real-time, dynamic view of running processes, sorted by CPU or memory usage.
- `view` 
  - Typically used as a read-only mode for text editors like Vim, not for process monitoring.
- `stat` 
  - Displays detailed metadata for a specific file or directory rather than system process data.

**Hint:** It sits at the "top" of the list.

### 29. What does "tar -cvf" do?

- Extracts an existing archive file
  - Extraction requires the "-x" flag; the "-c" flag used here stands for "Create."
- **Creates a new archive from files** ✅
  - Bundles multiple files into a single tarball for easier storage, transfer, or backup.
- Deletes a folder and its contents
  - Archive tools do not delete source files; folder removal is handled by the rm command.
- Encrypts a file for secure transport
  - The tar utility does not provide native encryption; a tool like gpg must be used after archiving.

**Hint:** Create, Verbose, File.

### 30. What is the PID 1 process?

- The Linux Kernel
  - The kernel manages processes but is not a process in the user-space table itself.
- **The Init system (like systemd)** ✅
  - The first process started by the kernel, responsible for launching all subsequent services.
- The Bash Shell
  - Bash is a user application started long after the init process has stabilized the system.
- The Root User
  - Root is a security identity (UID 0), not a specific process type or identification number.

**Hint:** The ancestor of all other processes.
