Free practice · No sign-up required

Linux Foundation Certified System Administrator free practice test

15 questions with answer explanations. Choose an answer below to begin.

Question 1 of 15

Which command is used to display the current system hostname?

Show hint

System Identification

0/15 answered · Bookmark questions to review later. Focus the practice area to use keys 1–9 and Enter.

Learn by doing

Put your answers into practice

Use official documentation and hands-on labs to work through topics you missed.

Explore all study resources →

All questions and explanations

Prefer to read at your own pace? Work through each question below, then open its answer to check your reasoning. You can link directly to a question or print this reference.

  1. Which command is used to display the current system hostname?

    1. hostnamectl

    2. hostname

    3. host

    4. domainname

    Show answer and explanation

    Correct answer

    • hostname

    The hostname command prints or sets the system's host name, while hostnamectl is used on systemd systems to query and change the hostname persistently.

  2. What is the default numeric user ID (UID) range for regular users on most Linux distributions?

    1. 0-99

    2. 100-999

    3. 1000-60000

    4. 500-5000

    Show answer and explanation

    Correct answer

    • 1000-60000

    Regular user accounts typically start at UID 1000 and extend to a high value such as 60000, whereas UIDs 0-99 are reserved for system accounts.

  3. Which file system is commonly used by default for new extents-based installations on modern Linux systems?

    1. ext2

    2. ext3

    3. ext4

    4. xfs

    Show answer and explanation

    Correct answer

    • ext4

    ext4 is the widely adopted journaling file system for modern Linux installations, offering improved performance and reliability over ext3.

  4. What does the runlevel 3 represent in a traditional SysV init system?

    1. Graphical multi-user mode

    2. Single-user mode

    3. Multi-user mode without networking

    4. Multi-user mode with networking

    Show answer and explanation

    Correct answer

    • Multi-user mode with networking

    Runlevel 3 is defined as multi-user mode with networking enabled, providing a command-line interface for multiple users.

  5. Which command is used to securely copy files between hosts on a network?

    1. rcp

    2. ftp

    3. scp

    4. sftp

    Show answer and explanation

    Correct answer

    • scp

    scp (secure copy) uses SSH to transfer files securely between hosts, whereas rcp is unencrypted and less commonly used.

  6. What is the purpose of the /etc/fstab file?

    1. Stores user passwords

    2. Defines file system mount points

    3. Contains system log entries

    4. Holds kernel modules

    Show answer and explanation

    Correct answer

    • Defines file system mount points

    /etc/fstab contains static information about file systems and defines how and where they are mounted at boot time.

  7. Which command allows a user to execute commands with the security privileges of another user, typically root?

    1. sudo

    2. su

    3. runas

    4. elevate

    Show answer and explanation

    Correct answer

    • sudo

    sudo enables a permitted user to execute a command as the superuser or another user, as defined in the sudoers file.

  8. Which directory is the standard location for storing variable data such as logs and spool files?

    1. /etc

    2. /boot

    3. /var

    4. /usr

    Show answer and explanation

    Correct answer

    • /var

    /var is designated for variable data files, including logs (/var/log), mail spool (/var/mail), and cache data.

  9. What is the primary function of the systemd init system?

    1. Manage hardware drivers

    2. Provide a shell environment

    3. Control system services and dependencies

    4. Compile kernel modules

    Show answer and explanation

    Correct answer

    • Control system services and dependencies

    systemd is a system and service manager for Linux that provides aggressive parallelization, socket and D-Bus activation, and other features to manage services.

  10. Question 10

    Link to question

    Which command is used to display the contents of a directory, including file permissions and ownership?

    1. ls

    2. dir

    3. list

    4. show

    Show answer and explanation

    Correct answer

    • ls

    The ls command lists directory contents with detailed metadata such as permissions, owner, size, and timestamp.

  11. Question 11

    Link to question

    What is the default shell for new user accounts on most Linux systems?

    1. sh

    2. csh

    3. bash

    4. zsh

    Show answer and explanation

    Correct answer

    • bash

    bash (Bourne Again SHell) is the default interactive shell for regular users on many Linux distributions.

  12. Question 12

    Link to question

    Which log file is commonly used to record authentication-related events such as SSH logins?

    1. /var/log/syslog

    2. /var/log/kern.log

    3. /var/log/auth.log

    4. /var/log/dmesg

    Show answer and explanation

    Correct answer

    • /var/log/auth.log

    /var/log/auth.log (on Debian-based systems) records authentication and security-related events, including failed login attempts.

  13. Question 13

    Link to question

    Which command is used to check the syntax of a shell script without executing it?

    1. bash -x

    2. bash -n

    3. bash -v

    4. bash -c

    Show answer and explanation

    Correct answer

    • bash -n

    The -n flag tells bash to read the commands but not execute them, which is useful for syntax checking.

  14. Question 14

    Link to question

    What is the purpose of the chmod command?

    1. Change file ownership

    2. Modify file access permissions

    3. Rename files

    4. Delete files securely

    Show answer and explanation

    Correct answer

    • Modify file access permissions

    chmod changes the access permissions of files and directories using symbolic or numeric modes.

  15. Question 15

    Link to question

    Which command is used to display the current working directory path?

    1. pwd

    2. cd

    3. ls

    4. echo $HOME

    Show answer and explanation

    Correct answer

    • pwd

    pwd (print working directory) outputs the full path of the current directory.

Read all flashcards

Recall the answer before opening each card.

Which command displays the current system hostname?

hostname prints the hostname. For persistent changes, use hostnamectl on systemd systems.

What is the default UID range for regular users?

Regular users typically have UIDs from 1000 to 60000. System accounts use UIDs 0-99.

Which filesystem is the default for modern Linux installations?

ext4 is the default journaling filesystem, offering extents and improved performance over ext3.

What does runlevel 3 represent in SysV init?

Runlevel 3 is multi-user mode with networking, providing a command-line interface for multiple users.

Which command securely copies files between hosts?

scp (secure copy) uses SSH for encrypted file transfers between hosts.

What is the purpose of /etc/fstab?

/etc/fstab defines static mount points for filesystems, specifying how and where they mount at boot.

Which command allows executing commands as another user?

sudo permits a permitted user to execute commands as the superuser or another user, as defined in /etc/sudoers.

Which directory stores variable data like logs?

/var holds variable data, including logs (/var/log), mail spool, and cache files.

What is the primary function of systemd?

systemd is a system and service manager that controls services, dependencies, and provides parallelization and activation features.

Which command lists directory contents with permissions?

ls with options like -l lists files with permissions, owner, size, and timestamp.

What is the default shell for new users on most Linux systems?

bash (Bourne Again SHell) is the default interactive shell for regular users.

Which log file records authentication events on Debian?

/var/log/auth.log records authentication and security events, including SSH logins and sudo usage.

Which command checks shell script syntax without execution?

bash -n reads commands but does not execute them, performing a syntax check.

What is the purpose of chmod?

chmod modifies file access permissions using symbolic (e.g., u+x) or numeric (e.g., 755) modes.

Which command prints the current working directory?

pwd (print working directory) outputs the full path of the current directory.

How do you set a persistent hostname on systemd systems?

Use hostnamectl set-hostname to change the hostname persistently. hostname changes are temporary.

What is the UID for the root user?

Root has UID 0. System accounts use UIDs 1-99, and regular users start at UID 1000.

What is the default filesystem type in /etc/fstab for many Linux systems?

ext4 is commonly specified as the filesystem type in /etc/fstab for modern installations.

Which SysV runlevel corresponds to multi-user mode without networking?

Runlevel 2 typically represents multi-user mode without networking, though distributions may vary.

What is the difference between scp and rcp?

scp uses SSH encryption for secure transfers, while rcp is unencrypted and less secure.

Active recall deck

Practice Linux Foundation Certified System Administrator with real flashcards

Read the prompt, commit to an answer, then flip the card. Move through the deck at your own pace and repeat any topic that does not come back quickly.

20 free cards

Card 1 of 20

1 reviewed this session

Connect the concepts

Your Linux Foundation Certified System Administrator study mind map

Open a branch to connect a topic with its practice questions and explanations. Use the map to choose your next review topic.

Linux Foundation Certified System Administrator15 questions in this practice set
System Identification(1)
User and Group Management(1)
Storage Management(1)
System Initialization(2)
File Transfer and Management(1)
System Configuration(1)
Privilege Escalation(1)
Filesystem Hierarchy Standard(1)
File and Directory Management(2)
User Environment(1)
Log Analysis(1)
Scripting and Debugging(1)
More practice connections(1)
Exam-focused analysis

What this LFCS practice set measures

This is an analysis of the practice bank, not a claim about the vendor's live exam blueprint. Use it to identify the knowledge, judgment, and recall patterns exercised here, then verify your coverage against the current official exam guide.

System Basics and Identification

This section covers fundamental commands and concepts for identifying and navigating the system. The hostname command displays the current hostname, while hostnamectl is used for persistent changes on systemd systems. The ls command lists directory contents with permissions and ownership, and pwd shows the current working directory. The default shell for new users is bash, as defined in /etc/default/useradd or /etc/passwd. Understanding these basics is essential for efficient system administration.

  • Use hostname to display system hostname; hostnamectl for persistent changes.
  • ls -l provides detailed file metadata including permissions and ownership.
  • pwd outputs the full path of the current directory.
  • bash is the default shell for most Linux distributions.

User and Permission Management

Effective user and permission management is critical for system security. Regular users have UIDs from 1000 to 60000, while system accounts use lower UIDs. The sudo command allows privileged command execution as defined in /etc/sudoers. The chmod command modifies file access permissions using symbolic or numeric modes. Understanding UID ranges and permission commands is fundamental for user administration.

  • Regular users typically have UIDs in the range 1000-60000.
  • sudo executes commands with privileges of another user, usually root.
  • chmod changes file permissions; common modes: chmod 755 or chmod u+x.
  • The /etc/sudoers file controls sudo access; edit with visudo.

Storage and File System Management

Storage management involves understanding file systems and mount points. ext4 is the default journaling filesystem for modern Linux installations. The /etc/fstab file defines static mount points for partitions at boot. The /var directory stores variable data like logs and spools. The scp command securely transfers files between hosts over SSH. These components are key to maintaining reliable storage.

  • ext4 is the default filesystem for modern Linux; supports extents and journaling.
  • /etc/fstab contains entries for automatic mounting of filesystems.
  • /var holds variable data: logs (/var/log), mail spool, caches.
  • scp uses SSH for encrypted file transfer between hosts.

System Initialization and Logging

System initialization and logging are crucial for boot and troubleshooting. In SysV init, runlevel 3 represents multi-user mode with networking. systemd is the modern init system that manages services and dependencies. Authentication events like SSH logins are recorded in /var/log/auth.log on Debian-based systems. The bash -n command checks script syntax without execution. These tools help administrators control startup and diagnose issues.

  • SysV runlevel 3: multi-user with networking (command-line interface).
  • systemd uses units to manage services; use systemctl to control them.
  • /var/log/auth.log records authentication events (Debian/Ubuntu).
  • bash -n performs a syntax check without running the script.

Study workflow

Turn one LFCS attempt into a study plan

  1. 1

    Check System Information

    Use hostname to display the hostname. For persistent changes, use hostnamectl set-hostname. Use ls -la / to list root directory with details. Use pwd to confirm your current location. Use uname -a for kernel details. This step establishes your system's identity.

  2. 2

    Manage Users and Groups

    Add users with useradd; set passwords with passwd. Check UID range: default is 1000-60000 for regular users. Use sudo -l to list commands you can execute with sudo. Modify permissions with chmod, e.g., chmod 755 file. Manage groups with groupadd and usermod -G.

  3. 3

    Work with File Permissions

    Use chmod to change permissions: symbolic (chmod u+x file) or numeric (chmod 644 file). Use chown to change owner. Use ls -l to view current permissions. Understand rwx for owner, group, others. For directories, ensure execute permission to access contents.

  4. 4

    Configure Storage and Mounts

    Edit /etc/fstab to add mount points for partitions. Use mount -a to mount all entries. Use df -h to check disk usage. For file transfer, use scp source user@host:destination. Ensure the filesystem type (e.g., ext4) is correct in fstab.

  5. 5

    Analyze Logs and Services

    Check authentication logs: less /var/log/auth.log. Use systemctl to manage services: systemctl status service, systemctl enable service. For script debugging, use bash -n script.sh to check syntax. Use journalctl for systemd logs if available.

FAQ

Questions about this LFCS practice page

Clear boundaries on what the bank covers, how to use it, and where official vendor information still matters.

What is the difference between hostname and hostnamectl?+

hostname displays or sets the hostname temporarily; the change is lost after reboot. hostnamectl on systemd systems sets the hostname persistently and also manages pretty hostnames. Always use hostnamectl for permanent changes on modern distributions.

What UID range should I use for new regular users in LFCS?+

In LFCS environments, regular users typically start at UID 1000 and extend up to 60000. System accounts use UIDs 0-99. When creating users with useradd, the system automatically assigns the next available UID in the 1000-60000 range.

How does systemd handle runlevels compared to SysV init?+

SysV init uses numbered runlevels (e.g., 3 for multi-user mode). systemd uses targets, such as multi-user.target or graphical.target, which are symbolic links to runlevels. Use systemctl isolate multi-user.target to switch to runlevel 3 equivalent.

What is the purpose of /etc/fstab and how do I edit it safely?+

/etc/fstab defines static mount points for filesystems. It is read at boot to mount partitions. Always back up the file before editing, and use mount -a to test changes without rebooting. Incorrect entries can prevent the system from booting.

Which log file records failed login attempts on Debian-based systems?+

Failed login attempts are recorded in /var/log/auth.log on Debian-based systems. On Red Hat-based systems, similar information is in /var/log/secure. Use grep to search for 'Failed password' to find unsuccessful attempts.

Keep studying

Build the next review session

Browse another free bank or use the study strategy guide to turn your misses into spaced review.