Courseiva

LFCS · domain

Essential Commands

Use this page to practise Essential Commands questions for this certification. Focus on how the exam tests essential commands in scenario format — understanding the why behind each answer builds more durable knowledge than memorising options.

97 questions28 easy39 medium30 hard

Focused practice

Practice Essential Commands questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Essential Commands

Essential Commands questions on this certification test your ability to deploy and manage essential commands concepts in scenario-based situations.

Core Essential Commands concepts and how they apply in real-world cloud scenarios.

How to deploy essential commands correctly and verify the outcome.

Troubleshooting essential commands issues by interpreting error output and system state.

Cloud best practices and Essential Commands design trade-offs tested by this certification.

Watch out for

Common Essential Commands exam traps

  • Selecting the most expensive service when a simpler managed option meets the requirement.
  • Forgetting that cloud resources must be explicitly secured — defaults are rarely secure.
  • Choosing a global service fix when the issue is region-specific.
  • Overlooking cost implications of cross-region data transfer in architecture questions.

Question index

All Essential Commands questions (97)

Click any question to see the full explanation, or start a practice session above.

1

A user wants to find all files in /var/log that have been modified within the last 2 days. Which command should they use?

Easy
2

Which THREE of the following statements about Linux file permissions are correct?

Medium
3

A DevOps engineer wants to list all running processes sorted by memory usage in descending order. Which command should be used?

Hard
4

Which THREE of the following commands can be used to view the contents of a compressed file named 'file.gz' without permanently decompressing it? (Choose exactly three.)

Medium
5

Which TWO commands can display the current environment variables?

Easy
6

A developer needs to extract the third column from a CSV file where columns are separated by commas, but some fields contain commas within double quotes. Which command correctly handles this?

Hard
7

Refer to the exhibit. The output of 'ps aux' shows a process named 'process_hog' with PID 1234 consuming 99.5% CPU. The process is stuck in an infinite loop and does not respond to SIGTERM. Which signal should be used to forcefully terminate it?

Hard
8

You are managing a Linux server that hosts a critical web application. The server is running low on disk space in the root filesystem, and you need to free up space urgently. You run 'df -h' and see that /dev/sda1 is mounted on / and is 95% full. You also notice that /var/log/messages is over 2 GB in size. The application writes logs to /var/log/app.log, which is also large. The server has a separate /var partition that has plenty of free space. The application must continue running with minimal downtime. You need to compress and rotate logs without losing any data, and ensure that the root filesystem has at least 10% free space. Which of the following actions should you take first to achieve this goal?

Hard
9

An administrator wants to terminate a process with PID 1234 and all its child processes. Which command should be used?

Medium
10

A cron job runs a script every hour but sometimes fails because the script cannot find commands like 'tar' and 'gzip'. The script works when run manually from a terminal. What is the best fix?

Hard
11

A system administrator wants to kill a process with PID 1234 that is not responding to SIGTERM. Which command will forcefully terminate it?

Hard
12

A user wants to continuously monitor a log file that is being written to by a running service. Which command achieves this?

Easy
13

Based on the exhibit, which process will be affected if the root user runs 'kill 5678'?

Hard
14

A user 'dba' tries to login via SSH and fails. Based on the exhibit, what is the most likely cause?

Medium
15

A system administrator needs to find all files in /var/log that have been modified in the last 24 hours. Which command accomplishes this?

Easy
16

A system administrator is troubleshooting a user's report that a command 'myapp' is not found. The administrator checks the PATH variable and sees it includes /usr/local/bin. The administrator verifies that the binary 'myapp' exists in /usr/local/bin with permissions 755. However, running 'myapp' still fails with 'command not found'. What is the most likely cause?

Medium
17

A DevOps engineer wants to measure how long a specific command takes to execute. Which command should be used?

Medium
18

Refer to the exhibit. The administrator receives alerts that the root filesystem is almost full. Which command could free up space by removing old log files?

Medium
19

A system administrator is managing a production web server running CentOS 7. The server hosts a critical application that depends on the 'httpd' package. Recently, the administrator attempted to install an updated version of httpd using 'yum update httpd', but the update failed with a dependency error: 'Error: Package: httpd-2.4.6-97.el7.centos.x86_64 requires libapr-1.so.0()(64bit)'. The administrator verifies that the apr package is installed (apr-1.5.2-6.el7.x86_64) and that the required library file exists at /usr/lib64/libapr-1.so.0. Despite this, yum continues to fail with the same error. After checking the yum repository configuration, the administrator notices that the base repository lists 'mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os' and the 'baseurl' is commented out. The system's /etc/yum.conf has 'keepcache=1'. What is the most likely cause of the dependency error, and which command should the administrator run to resolve it?

Hard
20

Match each Linux permission type to its symbolic representation.

Medium
21

A user wants to set the permissions of a file to 'rwxr-xr--'. Which octal permission value should they use with chmod?

Easy
22

A process is consuming 99% CPU and is unresponsive to normal shutdown requests. After running 'top', you see the PID is 1234. What is the most appropriate command to stop the process gracefully first?

Hard
23

A system administrator needs to find all files in /home that are owned by user 'alice' and have been modified in the last 7 days. The administrator then wants to compress those files into a single archive named alice_recent.tar.gz. Which of the following commands accomplishes this?

Hard
24

To display the first 10 lines of a file named 'log.txt', which command is correct?

Easy
25

A system administrator wants to display a list of all currently running processes with their parent process IDs. Which command is most appropriate?

Medium
26

A system administrator notices that the disk space on the root filesystem is at 95% usage. After investigating, they find that a large log file named 'access.log' in /var/log is taking up significant space. The administrator deletes the file using 'rm /var/log/access.log' but the disk usage remains at 95%. Running 'df -h' still shows the same usage. What is the most likely cause and the correct next step?

Easy
27

An administrator wants to ensure that a background process continues running after logout. Which command should be used to start the process?

Hard
28

A security policy requires that all users in the 'webadmin' group should have read and write access to files in /var/www/html. New files created in that directory should automatically be assigned to the 'webadmin' group and have group read/write permissions. Which combination of permissions and group ownership should be set on /var/www/html?

Medium
29

A system administrator needs to stop a misbehaving process gracefully, allowing it to clean up resources. The process is unresponsive to the standard SIGTERM signal. What should the administrator do next?

Medium
30

A system administrator needs to find all files under /var/log that have been modified within the last 7 days. Which command accomplishes this task?

Medium
31

A user wants to view the contents of a compressed log file /var/log/syslog.2.gz without decompressing it first. Which command should they use?

Easy
32

A user reports that they cannot delete a file named 'important.txt' located in their home directory. The file is owned by the user and the user has write permission on the directory. Running 'rm important.txt' produces the error: 'rm: cannot remove 'important.txt': Operation not permitted'. The user has also tried using 'sudo rm' but gets the same error. Which of the following is the most likely cause and correct solution?

Easy
33

A user reports that a shell script 'backup.sh' in /home/user/scripts fails to execute. What is the most likely cause?

Easy
34

Refer to the exhibit. A user attempts to create a file in /backup/snapshots/ but receives an error. What is the most likely cause?

Hard
35

Which TWO commands can be used to display the current working directory?

Easy
36

Which THREE commands can be used to view the contents of a compressed archive file without extracting it? (Select three.)

Medium
37

A system administrator has a cron job that runs a backup script. The script requires the variable BACKUP_DIR to be set, but the administrator cannot modify the script. Which is the most appropriate place to define the variable for cron?

Medium
38

A system administrator monitors a server that periodically becomes unresponsive for a few seconds. Investigation reveals that the kernel OOM killer is being invoked, but standard memory usage monitoring tools like 'free' and 'top' show less than 50% memory usage. The server runs a web server and a database. Which of the following is the most likely cause and diagnostic step?

Hard
39

You are a system administrator for a company that runs a web server on a Linux system. The web server logs are stored in /var/log/nginx/access.log. The log file grows rapidly and rotates weekly via logrotate. The system has been running for several months. Recently, the development team reported that the web server is responding slowly. You suspect that the disk I/O might be high due to log file activity. You check the disk usage and find that /var/log/nginx/access.log is 4 GB, and the rotated logs (access.log.1.gz, access.log.2.gz, etc.) total another 10 GB. The /var partition has 20 GB total, so it's 70% full. You decide to reduce the disk usage by compressing the current log file and truncating it without stopping the nginx service. Which command sequence should you use to safely achieve this?

Hard
40

A backup script must create a compressed archive of the /etc directory, preserving file permissions and timestamps. Which command should be used?

Medium
41

Which command displays the amount of free and used memory in the system?

Easy
42

A system administrator is troubleshooting a performance issue. They need to identify which process is consuming the most CPU time over the last 24 hours. Which command should be used?

Medium
43

A junior admin runs 'ls -l' and sees permissions '-rwxrwxr-x' on a file. What is the octal representation?

Medium
44

The backup script fails to run as user 'backup' with sudo. What is the issue?

Hard
45

Which TWO commands can be used to display the contents of a text file that has been compressed with gzip without decompressing it to disk?

Easy
46

Which TWO commands can be used to list the contents of a tar archive without extracting it?

Medium
47

Which TWO commands can be used to display the contents of a text file page by page? (Select two.)

Medium
48

A systems administrator needs to add a new user 'jdoe' with a home directory in /export/home, a UID of 1500, and an expiry date of 2025-12-31. Which command should they use?

Hard
49

Refer to the exhibit. The nginx service failed to start. What is the most likely immediate next step to diagnose the issue?

Medium
50

Based on the exhibit, what is the average CPU idle percentage over the last 15 minutes?

Easy
51

A user is unable to write to a file. The output of 'ls -l file' shows '-r--r--r--'. Which command will grant write permission to the owner?

Medium
52

A user is unable to execute a script in their home directory. The script has permissions -rw-r--r--. Which command will allow the user to execute the script?

Medium
53

A developer reports that a compiled binary 'app' fails to execute with 'Permission denied' error when run from a mounted directory '/mnt/software'. The binary has execute permissions for all users. What is the most likely cause?

Medium
54

A user wants to find the location of the 'grep' binary. Which command should they use?

Easy
55

Which TWO commands can be used to create a new empty file?

Hard
56

A user needs to view the contents of a compressed log file /var/log/syslog.gz without first decompressing it. Which command should they use?

Easy
57

Refer to the exhibit. A user attempts to read /etc/passwd and receives "Permission denied". What is the most likely reason?

Medium
58

To compress a file while preserving the original file, which command should be used?

Easy
59

Refer to the exhibit. The /var partition is 100% full. Which command can be used to find the largest files in /var/log to free up space?

Easy
60

A system administrator configures a new server with multiple disks. After partitioning and formatting, they mount a partition to /data. Several days later, they notice that the /data filesystem is full, but 'du -sh /data' reports only 2 GB used, while the partition is 100 GB. 'df -h' shows /data is 98% full. What is the most likely cause and the correct action?

Hard
61

A system administrator needs to list all files in the current directory, including hidden files, in a long listing format sorted by modification time (oldest first). Which command achieves this?

Medium
62

A user needs to view the contents of a large text file one screen at a time. Which command is best for this?

Easy
63

Which THREE commands can change the priority of an already running process?

Hard
64

What is the purpose of the chmod 755 command in this exhibit?

Medium
65

A system administrator runs 'grep -r 'error' /var/log' and gets many false positives. They want to search only for the exact word 'error' as a whole word, case-insensitively, and display line numbers. Which command should they use?

Hard
66

An administrator runs 'df -h' and notices that /dev/sda1 is 95% full. The administrator needs to identify the largest files in the filesystem. Which command sequence is most efficient?

Hard
67

A system administrator needs to change the group ownership of a file to 'developers' and set the setgid bit on a directory. Which two commands accomplish these tasks? (Choose two.)

Medium
68

Refer to the exhibit. The file script.sh has permissions -rwxr-x--- and is owned by root with group 'developers'. A user named 'alice' is a member of the 'developers' group. Which command allows alice to execute the script without changing the file's group ownership?

Medium
69

Which TWO commands can be used to display the current working directory? (Choose exactly two.)

Hard
70

A security audit reveals that a sensitive file '/etc/shadow' has been modified. The file's permissions are set to 600 and owned by root. However, the audit logs show that a service account 'webapp' was able to read the file. The 'webapp' user is not in the root group. Which of the following is the most likely method the 'webapp' user used to read the file?

Hard
71

A system administrator needs to replace all occurrences of 'oldhost' with 'newhost' in /etc/hosts, but only on lines that contain the string 'domain'. Which sed command accomplishes this?

Hard
72

A developer wants to change the ownership of a directory and all its contents recursively to user 'appuser' and group 'appgroup'. Which command accomplishes this?

Medium
73

A user wants to view the contents of a compressed file file.txt.gz without decompressing it permanently. Which two commands can be used? (Choose two.)

Easy
74

A user needs to see the contents of a gzip-compressed file 'data.txt.gz' without decompressing it. Which command is appropriate?

Easy
75

An administrator needs to replace all occurrences of the string 'foo' with 'bar' in all files under /etc/config, but only in files ending with .conf. The replacement must be done in-place, and backup copies should be created with a .bak extension. Which command accomplishes this?

Hard
76

To check the disk usage of the /var/log directory in a human-readable format, which command is appropriate?

Medium
77

An administrator runs 'ls -la' and sees the following entry for a file: 'lrwxrwxrwx 1 root root 24 Jan 10 12:00 link -> /etc/passwd'. If the target file /etc/passwd is deleted, what happens to the link file?

Hard
78

An administrator wants to print the last field of each line from a CSV file 'data.csv' (comma-separated). Which awk command accomplishes this?

Hard
79

Which TWO commands can be used to view the last 10 lines of a file and also follow new lines as they are written?

Medium
80

Which THREE of the following commands can be used to search for a string in multiple files and display the matching lines?

Hard
81

Refer to the exhibit. The /data directory needs to be resized to 15GB. What is the first step?

Easy
82

A database administrator wants to compress a large directory of log files for archival. The administrator uses the command: tar -cvf logs.tar.gz logs/. The command completes successfully but the resulting archive is only 10 MB while the original directory is 100 MB. What is the most likely reason?

Hard
83

A system administrator needs to find all files in /var/log that have been modified in the last 7 days. Which command accomplishes this?

Easy
84

A user reports that they cannot run a script because it says 'Permission denied'. The script is owned by root and has permissions -rw-r--r--. Which command would allow the user to execute the script?

Easy
85

A DevOps engineer is writing a continuous integration pipeline that runs a script to deploy an application. The script is stored in a Git repository and is executed on a build server. The script works locally on the engineer's workstation, but when executed on the build server, it fails with '/bin/sh: line 12: somecommand: command not found'. The 'somecommand' is a standard Linux tool that is installed on the build server. The build server uses a minimal Docker container. Which of the following is the most likely cause and solution?

Medium
86

A technician needs to display the contents of a compressed file named archive.tar.gz without extracting it. Which command should be used?

Medium
87

A user with uid 1000 tries to read /etc/shadow and gets 'Permission denied'. The user is not in the shadow group. Which of the following actions would allow the user to read the file without changing the file's group or permissions?

Medium
88

An administrator needs to find the process ID of the cron daemon. Which combination of commands is most effective?

Hard
89

Which THREE commands can be used to view the contents of a file?

Medium
90

A system administrator needs to find all files in /var/log that have been modified in the last 7 days. Which command accomplishes this?

Easy
91

A system administrator notices that '/var/log/syslog' has grown very large and is consuming significant disk space. The administrator wants to identify the largest log files in the '/var/log' directory hierarchy. Which command should the administrator use?

Easy
92

A script needs to search for lines containing 'ERROR' in /var/log/syslog and count them. Which command pipeline achieves this?

Medium
93

An administrator needs to compress a directory named 'project' into a tarball with maximum compression using gzip. Which command is appropriate?

Easy
94

A developer accidentally deleted a critical file /var/log/app.log. The system administrator knows that the file was recently backed up using a cron job that runs 'tar -czf /backup/logs.tar.gz /var/log/'. Which command should the administrator use to restore the file from the backup without extracting the entire archive?

Medium
95

A junior administrator needs to display the first 10 lines of a file named 'data.csv'. Which command should they use?

Easy
96

A user reports that a script fails with 'Permission denied' when executed. The script has permissions -rw-r--r-- and is owned by the user. Which command should the user run to make the script executable for the owner only?

Medium
97

Order the steps to mount an ext4 filesystem from an external USB drive automatically at boot.

Medium

Frequently asked questions

What does the Essential Commands domain cover on the LFCS exam?
Essential Commands questions on this certification test your ability to deploy and manage essential commands concepts in scenario-based situations.
How many questions are in this domain?
This page lists all 97 Essential Commands questions in the LFCS question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Essential Commands questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
Linux Foundation Certified System Administrator LFCS Essential Commands Practice Questions