VMware ESXi and vSphere Cluster Management

Linux Fundamentals Knowledge Quiz

Test foundational Linux knowledge with a self-paced quiz covering commands, cron, Bash, processes, permissions, networking, boot diagnostics, and storage.

This self-paced Linux fundamentals quiz is designed for beginners, introductory Linux students, and junior system administrators. It is not timed. Work through the questions, record your answers, and then use the answer key to calculate your score.

A score of 80% or higher is a pass. If you do not pass, review foundational Linux topics such as command-line usage, files and directories, permissions, users, and basic networking before attempting the quiz again.

Quiz instructions and scoring

  1. Answer every question without using the answer key.
  2. Give yourself one point for each correct answer.
  3. Divide your points by the total number of questions and multiply by 100.
  4. A passing result is 80% or higher.

Result states: A passing result means your answers demonstrate a suitable foundation for the topics tested. A result below 80% means you should study the relevant fundamentals, repeat the practical examples, and retry the assessment.

Quiz questions

Job scheduling

  1. Which scheduler is intended for recurring jobs on systems that may not run continuously?
    • A. cron
    • B. anacron
    • C. dmesg
    • D. renice
  2. What is a crontab used for?
    • A. Defining recurring scheduled tasks
    • B. Storing password hashes
    • C. Displaying kernel messages
    • D. Creating swap space
  3. In the system-wide entry below, what does the entry run, and under which account?
    15 2 * * 1 root /usr/local/sbin/weekly-cleanup
    • A. At 2:15 every Monday as root
    • B. At 15:02 every day as root
    • C. At 2:15 on the first day of every month as root
    • D. Every 15 minutes as the weekly-cleanup user
  4. What does a wildcard in a cron field mean? For example, what does the first * represent in * 4 * * *?
    • A. No value is accepted
    • B. Every permitted value for that field
    • C. The current user
    • D. The command is disabled

Shells and Bash scripts

  1. Which shell is widely used as a default interactive shell on many Linux distributions?
    • A. Bash
    • B. PowerShell only
    • C. BIOS
    • D. cron
  2. What is the purpose of this line at the beginning of an executable script?
    #!/bin/bash
    • A. It declares the interpreter that should run the script
    • B. It comments out the entire script
    • C. It changes the file owner
    • D. It starts a cron daemon
  3. Which statement correctly distinguishes a shell name from an interpreter path?
    • A. Bash is a shell name; /bin/bash is an executable path
    • B. Bash is always a directory; /bin/bash is a user account
    • C. They are both configuration files
    • D. Neither can be used in a script

Processes and priority

  1. What does a nice value represent?
    • A. A process scheduling preference
    • B. The process's network address
    • C. The file's owner
    • D. The amount of disk space used
  2. In general, what is the relationship between a higher numeric nice value and scheduling priority?
    • A. A higher nice value generally means a lower scheduling priority
    • B. A higher nice value always means a higher priority
    • C. Nice values apply only to files
    • D. Nice values terminate processes
  3. Which command changes the nice value of an already running process?
    • A. ps
    • B. renice
    • C. pwd
    • D. tar

Archives and account data

  1. What is the primary purpose of tar?
    • A. Packaging files and directories into an archive
    • B. Changing a process priority
    • C. Resolving DNS records
    • D. Displaying the current directory
  2. Which statement about archiving and compression is correct?
    • A. Archiving packages files; compression reduces their encoded size. They can be used together.
    • B. Archiving and compression are exactly the same operation.
    • C. Compression always creates a filesystem.
    • D. Tar can only process text files.
  3. Which file contains protected password hashes and password-aging information?
    • A. /etc/passwd
    • B. /etc/shadow
    • C. /etc/hosts
    • D. /proc
  4. Why is access to password hash information restricted?
    • A. Hashes and aging data are sensitive authentication information that could support offline password attacks
    • B. The file contains only printer settings
    • C. The file is required only during boot
    • D. It stores network interface hardware details

Permissions and navigation

  1. What does umask control?
    • A. Default permission restrictions applied when new files and directories are created
    • B. Permissions on every existing file immediately
    • C. The current working directory
    • D. Kernel boot messages
  2. Which command displays the current working directory?
    • A. pwd
    • B. passwd
    • C. lp
    • D. ifconfig

Virtual filesystems and diagnostics

  1. What is /proc?
    • A. A kernel-provided virtual filesystem exposing live process and system information
    • B. A normal user home directory
    • C. A compressed archive
    • D. A permanent swap partition
  2. What does uname -a generally display?
    • A. Broad kernel, machine, and operating-system identification details
    • B. Only the contents of /etc/hosts
    • C. All running processes with their nice values
    • D. The contents of a tar archive
  3. What is dmesg primarily used to inspect?
    • A. Kernel ring-buffer messages, including device detection and driver events
    • B. User password hashes
    • C. Cron field definitions
    • D. File creation masks

Networking and storage

  1. Which statement about Linux interface commands is correct?
    • A. ifconfig is a traditional utility; ip is the modern replacement on many systems
    • B. ipconfig is the standard Linux replacement for ifconfig
    • C. ifconfig edits password data
    • D. ip is used only to create archives
  2. What does /etc/hosts provide?
    • A. Local static mappings between IP addresses and hostnames
    • B. The default network gateway only
    • C. A list of installed hardware
    • D. Automatic wireless discovery
  3. What is swap?
    • A. Disk-backed virtual memory used when physical RAM is under pressure
    • B. A bootloader configuration file
    • C. A type of primary partition only
    • D. A network interface

Answer key and explanations

  1. B. Cron is designed for recurring jobs at specified times. Anacron is useful for periodic jobs on systems that may be powered off when a scheduled time arrives.
  2. A. A crontab is a schedule file or command interface for defining cron jobs.
  3. A. System crontab fields are minute, hour, day of month, month, day of week, user, and command. The job runs at 02:15 every Monday as root.
  4. B. A wildcard means every permitted value in that field. The example runs every minute during hour 4, subject to the other fields.
  5. A. Bash, the Bourne Again Shell, is a common command interpreter and scripting language.
  6. A. A shebang begins with #! and tells the operating system which interpreter to use when the script is executed.
  7. A. “Bash” names the shell; /bin/bash identifies an executable interpreter path. A system may use a different valid path, so verify it when troubleshooting.
  8. A. A nice value expresses a scheduling preference associated with a process.
  9. A. Increasing niceness generally makes a process more willing to yield CPU time, resulting in lower scheduling priority. Exact behavior also depends on the scheduler and workload.
  10. B. Use renice to change an existing process's nice value. Use ps to inspect processes, not to change their priority.
  11. A. Tar packages multiple files and directories into one archive.
  12. A. Archiving combines files into a package; compression reduces size. Common names include .tar, .tar.gz, .tgz, .tar.bz2, and .tar.xz.
  13. B. /etc/shadow is the restricted password and password-aging database. /etc/passwd contains general account information and normally does not contain the password hash.
  14. A. Restricting hashes reduces exposure of authentication data and makes offline cracking attempts harder.
  15. A. umask influences the default permissions of newly created filesystem objects. It does not directly change permissions on existing files; use tools such as chmod for that.
  16. A. pwd prints the shell's present working directory.
  17. A. /proc is a virtual filesystem populated by the kernel. Its entries represent live runtime information rather than ordinary files stored permanently on a disk.
  18. A. uname -a prints a broad set of kernel and operating-system identity details.
  19. A. dmesg displays kernel ring-buffer messages useful for reviewing initialization, device detection, drivers, and boot-related events. Distribution-specific logs may provide additional information.
  20. A. ifconfig is a traditional Linux utility. The ip suite, such as ip addr show, is preferred on many current distributions. Windows uses ipconfig, which is a different command.
  21. A. The hosts file supplies local static name mappings. It is distinct from DNS records, gateway configuration, hardware inventory, and automatic discovery.
  22. A. Swap can be a partition or a file. It provides disk-backed virtual memory when RAM is constrained, although heavy swap activity is usually much slower than using RAM.

Reference: cron scheduling

A user crontab commonly follows this pattern:

minute hour day-of-month month day-of-week command

A system-wide file such as /etc/crontab includes an additional account field:

minute hour day-of-month month day-of-week user command
Field positionMeaningValid valuesWildcard behavior
MinuteMinute of the hour0–59* means every minute
HourHour of the day0–23* means every hour
Day of monthCalendar day1–31* means every day of the month
MonthCalendar month1–12 or names supported by the implementation* means every month
Day of weekWeekday0–7 or names supported by the implementation; 0 and 7 commonly represent Sunday* means every weekday value
User field in system crontabAccount used to execute the commandFor example, root or another accountNot a schedule field
Command fieldCommand or script to executeA valid command lineNot a schedule field

For example, 30 1 * * 0 root /usr/local/sbin/report runs at 01:30 every Sunday as root in a system crontab. When a task does not run, check field order, whether the file is a user or system crontab, service status, logs, absolute command paths, and permissions.

Practical command examples

Create and run a Bash script

printf '#!/bin/bash\necho "Linux practice"\n' > practice.sh
chmod +x practice.sh
./practice.sh

The shebang selects Bash. If execution fails, verify the interpreter path, execute permission, and line endings. A file created on Windows may contain carriage returns that break the shebang.

Inspect and adjust a process

ps -eo pid,ni,comm
renice -n 5 -p 1234
ps -p 1234 -o pid,ni,comm

The first command displays process identifiers and nice values. renice changes the value for PID 1234, and the final command confirms the result. Changing priority may require appropriate ownership or elevated privileges; raising priority is subject to administrative limits.

Create and inspect an archive

tar -cf project.tar project/
tar -tf project.tar
tar -xf project.tar -C /tmp/project-copy

The first command creates an uncompressed archive, the second lists its contents, and the third extracts it. Compression utilities can be paired with tar to produce formats such as .tar.gz or .tar.xz.

Inspect identity, runtime data, and memory

pwd
uname -a
cat /proc/uptime
free -h
swapon --show

pwd reports location in the filesystem, uname -a reports system identity, and /proc/uptime exposes live kernel information. free -h shows RAM and swap totals, while swapon --show lists active swap areas.

Inspect networking and local name mappings

ifconfig
ip addr show
cat /etc/hosts

ifconfig may be unavailable on newer installations; use ip addr show as the preferred alternative. The hosts file can supply a local mapping that affects name lookup before or alongside DNS, depending on the system's resolver configuration.

Command identification reference

CommandPrimary purposeRelated conceptCommon misconception
anacronRun periodic jobs on systems that may not be continuously powered onJob schedulingIt is not identical to a cron entry that must run at an exact minute
reniceChange the nice value of a running processProcess schedulingps inspects processes but does not change their priority
tarCreate, list, and extract archivesArchiving and compressionTar archives are not automatically compressed
umaskView or set the default creation permission maskPermissionsIt does not modify permissions on existing files
pwdPrint the current working directoryFilesystem navigationIt is not an account or printing command
uname -aDisplay broad kernel and OS identity detailsSystem informationIt does not show all hardware inventory
dmesgDisplay kernel ring-buffer messagesBoot and device diagnosticsIt is not a general application log viewer
ifconfigDisplay traditional network interface settingsNetworkingIt is not the Windows ipconfig command
ipInspect and configure modern Linux network objectsNetworkingIt is not limited to displaying IPv4 addresses

System files and virtual filesystems

PathPurposeTypical contentsAccess or safety considerations
/etc/crontabSystem-wide recurring job configurationSchedule fields, execution account, and commandEdit carefully; syntax errors can prevent jobs from running
/etc/shadowProtected account-password and aging databasePassword hashes, expiration, and aging fieldsRestrict access; do not expose or casually edit authentication data
/etc/hostsLocal hostname-to-address mappingIP addresses, hostnames, and aliasesIncorrect entries can send local traffic to the wrong address
/procKernel-provided virtual filesystemProcess details, uptime, memory, devices, and runtime settingsContents are live and may change; not all entries are ordinary disk files

Linux networking command comparison

ToolPlatform or eraTypical useCurrent relevance
ifconfigTraditional Linux and Unix utilityDisplay or configure interfacesLegacy; may require the net-tools package
ipModern Linux utility suiteInspect and configure addresses, links, routes, and other network objectsPreferred on many current distributions
ipconfigWindows commandDisplay Windows IP configurationDo not substitute it for Linux ip

Troubleshooting checklist

  • Scheduled task: Check minute-hour ordering, user versus system crontab format, cron service status, logs, absolute paths, and permissions.
  • Bash script: Validate the shebang, execute permission, Bash installation, and line endings.
  • renice access error: Confirm process ownership and use elevated privileges only when appropriate. Raising priority may be restricted.
  • ifconfig not found: Use ip addr. Install the legacy net-tools package only when compatibility requires it.
  • Unexpected hostname address: Inspect /etc/hosts, resolver configuration, and DNS independently.
  • High swap use and slow performance: Check RAM and swap with free -h and swapon --show, identify memory-heavy processes, and evaluate workload or capacity changes.

For another attempt, return to the Linux Quiz and improve the topics represented by any missed answers.