Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

← GNU and Unix Commands practice sets

LPIC-1 GNU and Unix Commands • Complete Question Bank

LPIC-1 GNU and Unix Commands — All Questions With Answers

Complete LPIC-1 GNU and Unix Commands question bank — all 0 questions with answers and detailed explanations.

38
Questions
Free
No signup
Certifications/LPIC-1/Practice Test/GNU and Unix Commands/All Questions
Question 1mediummultiple choice
Read the full GNU and Unix Commands explanation →

A systems administrator needs to change the permissions of the file /home/user/script.sh so that the owner can read, write, and execute; the group can read and execute; and others have no access. Which command accomplishes this?

Question 2easymulti select
Read the full GNU and Unix Commands explanation →

Which TWO commands can be used to view the contents of a compressed file named archive.tar.gz without extracting it to disk?

Question 3hardmultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. An administrator needs to edit /etc/example.conf to change setting1 to 'production' and add a new line 'setting2=value' after the include line. The file must be edited in place without creating a backup. Which command sequence achieves this?

Network Topology
-rw-rrRefer to the exhibit.# ls -l# cat /etc/example.conf# Configuration filesetting1=default# Include other configinclude /etc/example.d/*.conf
Question 4mediummultiple choice
Read the full GNU and Unix Commands explanation →

You are a Linux administrator for a company that runs a web server on a system with limited disk space. The web server logs are stored in /var/log/httpd/access_log and grow quickly. The operations team requires that the most recent logs be available for troubleshooting, but logs older than 7 days must be compressed to save space. You decide to implement log rotation using logrotate. The logrotate configuration file for httpd currently contains:

/var/log/httpd/*.log { daily rotate 7 compress delaycompress missingok notifempty sharedscripts postrotate /bin/systemctl reload httpd 2>/dev/null || true endscript

}

After applying this configuration, you notice that log files are being compressed immediately instead of after one rotation. What is the most likely cause and the correct step to fix this?

Question 5mediumdrag order
Read the full GNU and Unix Commands explanation →

Arrange the steps to configure a static IP address on a Linux system using the command line.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4
5Step 5
Question 6mediumdrag order
Read the full GNU and Unix Commands explanation →

Order the steps to recover a forgotten root password on a Linux system.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4
5Step 5
Question 7mediummatching
Read the full GNU and Unix Commands explanation →

Match each Linux runlevel to its typical description.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Halt

Single-user mode

Multi-user with networking

Multi-user with GUI

Reboot

Question 8mediummatching
Read the full NAT/PAT explanation →

Match each device file naming pattern to its device type.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

First SCSI/SATA disk

First NVMe SSD

First serial port (COM1)

First loopback device

First software RAID device

Question 9easymultiple choice
Read the full GNU and Unix Commands explanation →

A systems administrator needs to find all files in /var/log that were modified in the last 24 hours and contain the word 'error'. Which command accomplishes this?

Question 10easymultiple choice
Read the full GNU and Unix Commands explanation →

An administrator wants to change the ownership of a file to user 'jane' and group 'staff'. Which command should be used?

Question 11mediummultiple choice
Read the full GNU and Unix Commands explanation →

A developer is troubleshooting a shell script that uses the variable $HOME but it outputs nothing when the script runs. The script is executed with ./script.sh from an interactive shell. What is the most likely cause?

Question 12mediummultiple choice
Read the full GNU and Unix Commands explanation →

An administrator needs to copy a directory hierarchy from one server to another over SSH, preserving permissions, ownership, and timestamps. Which command is most appropriate?

Question 13hardmultiple choice
Read the full GNU and Unix Commands explanation →

An administrator runs the command 'find / -name "*.conf" 2>/dev/null | head -n 10' and notices that the command returns very quickly. Which statement best describes what happened?

Question 14hardmultiple choice
Read the full NAT/PAT explanation →

A script uses 'set -e' and then executes 'grep pattern file'. If the pattern is not found, the script exits. Which of the following modifications would prevent the script from exiting while still allowing detection of the pattern's absence?

Question 15mediummultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. Which file has a special permission that allows a user to execute the file with the privileges of the file owner?

Exhibit

-rwxr-xr-x 1 root root 12345 Jan 1 12:00 /usr/bin/myapp
-rwsr-xr-x 1 root root 23456 Jan 1 12:00 /usr/bin/su
-rw-rw-rw- 1 user1 user1 0 Jan 1 12:00 /tmp/shared
Question 16hardmultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. The process with PID 1234 is in state 'Z'. What is the most likely cause and appropriate action?

Exhibit

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1  22564  4500 ?        Ss   Jan01   0:00 /sbin/init
user1      1234  0.0  0.0      0     0 ?        Z    Jan01   0:00 [defunct]
user1      1235  0.0  0.1  12345  2000 ?        S    Jan01   0:00 bash
Question 17easymultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. Which file system is full and what is the likely consequence if the administrator does not take action?

Exhibit

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1       10485760 9437184   1048576  90% /
/dev/sdb1       20971520 20971520       0 100% /var
Question 18mediummulti select
Read the full GNU and Unix Commands explanation →

Which TWO commands can be used to display the contents of a compressed file without decompressing it to disk? (Choose two.)

Question 19hardmulti select
Read the full GNU and Unix Commands explanation →

Which TWO of the following are valid methods to run a shell script named 'script.sh' using the bash shell, assuming the script has execute permission? (Choose two.)

Question 20easymulti select
Read the full GNU and Unix Commands explanation →

Which THREE of the following are correct features of the 'grep' command? (Choose three.)

Question 21easymultiple choice
Read the full GNU and Unix Commands explanation →

A system administrator wants to list all files in a directory that have been modified in the last 24 hours. Which command would be most appropriate?

Question 22mediummultiple choice
Read the full GNU and Unix Commands explanation →

After receiving a compressed tarball archive.tar.gz from a colleague, you want to list its contents without extracting. Which command should you use?

Question 23hardmultiple choice
Read the full GNU and Unix Commands explanation →

A developer wants to change the ownership of all files in a directory tree to the user 'www-data' and group 'www-data', but only files that are currently owned by user 'nobody'. Which command accomplishes this?

Question 24mediummultiple choice
Read the full GNU and Unix Commands explanation →

Which command is used to compress a file with the highest compression ratio?

Question 25mediummulti select
Read the full GNU and Unix Commands explanation →

Which TWO commands can be used to display the contents of a compressed text file (e.g., .gz, .bz2) directly to standard output without decompressing to disk?

Question 26hardmulti select
Read the full GNU and Unix Commands explanation →

Which THREE of the following are valid symbolic mode expressions for the chmod command?

Question 27mediummultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. When will the backup script run?

Exhibit

Refer to the exhibit.

30 4 1 * * /usr/bin/backup
Question 28hardmultiple choice
Read the full NAT/PAT explanation →

A company runs a legacy application on a Linux server. The application fails to start after a reboot, claiming a 'cannot open shared object file' error. The system administrator checks the library path and finds that the required library is present in /usr/local/lib but the application cannot find it. The administrator has verified that the library file exists and is readable. Which of the following is the most likely cause and solution?

Question 29mediummultiple choice
Read the full network assurance explanation →

A system administrator notices that the system's syslog messages are not being written to /var/log/messages. The rsyslog service is running. The administrator wants to check the configuration syntax of rsyslog. Which command should be used?

Question 30easymultiple choice
Read the full GNU and Unix Commands explanation →

A user reports that when they run 'ls -l' in their home directory, they see files but all files have permissions like '-rwxrwxrwx', which is unexpected. The system administrator checks and finds that the user's umask is set to 000. The user wants all new files to be created with default permissions of -rw-r--r-- (644) and directories that are drwxr-xr-x (755). What should the user set their umask to?

Question 31easymulti select
Read the full GNU and Unix Commands explanation →

Which TWO of the following commands output the total number of lines in a file?

Question 32mediummultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. What will be the default permissions of a newly created file using the touch command?

Exhibit

0022
Question 33hardmultiple choice
Read the full GNU and Unix Commands explanation →

A web server runs Apache and generates extensive access logs. To conserve disk space, an administrator sets up a cron job that runs nightly at 2:00 AM. The job executes a shell script located at /usr/local/bin/rotate_logs.sh. The script is intended to find all .log files in /var/log/apache2/ that are older than 7 days, compress them with gzip, and move the compressed files to /var/log/archive/. However, after several days, the administrator notices that the /var/log partition is nearly full and the logs are not being compressed. The cron log shows the job ran at the scheduled time but produced no terminal output (stdout or stderr). The script itself contains no explicit echo statements or error handling. The administrator has root access and wants to diagnose the problem without disrupting the running web server. Which of the following is the most appropriate first step to identify the failure?

Question 34mediummultiple choice
Study the full Python automation breakdown →

Refer to the exhibit. A user runs 'python --version' and gets 'Python 3.9.1'. Which command would run Python 2 instead?

Network Topology
$ pythonversion$ ls -l /usr/bin/python*Python 3.9.1$ file /usr/bin/python/usr/bin/python: symbolic link to python3
Question 35mediummultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. Which statement is true about SSH root login on this server?

Exhibit

$ cat /etc/ssh/sshd_config | grep -i "PermitRootLogin"
PermitRootLogin prohibit-password
$ cat /etc/ssh/sshd_config | grep -i "PasswordAuthentication"
PasswordAuthentication no
Question 36hardmultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. The remount command fails. What is the most likely cause?

Exhibit

$ cat /etc/fstab
/dev/sda1 /boot ext4 defaults 0 2
/dev/sda2 / ext4 defaults 0 1
/dev/sda3 none swap sw 0 0
/dev/sdb1 /data ext4 defaults 0 2
$ mount -o remount /data
mount: /data: mount point not mounted or bad option.
Question 37mediummultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. Which users are allowed to use the 'at' command?

Exhibit

$ cat /etc/at.allow
root
user1
$ cat /etc/at.deny
user2
user3
Question 38hardmultiple choice
Read the full GNU and Unix Commands explanation →

Refer to the exhibit. The system fails to boot with an error 'UUID=e5f6g7h8 not found'. Which is the most likely cause?

Exhibit

$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Dec 17 10:00 a1b2c3d4 -> ../../sda1
lrwxrwxrwx 1 root root 10 Dec 17 10:00 e5f6g7h8 -> ../../sda2
$ blkid /dev/sda1
/dev/sda1: UUID="a1b2c3d4" TYPE="ext4"
$ blkid /dev/sda2
/dev/sda2: UUID="e5f6g7h8" TYPE="ext4"
$ cat /etc/fstab
UUID=a1b2c3d4 /boot ext4 defaults 0 2
UUID=e5f6g7h8 / ext4 defaults 0 1

Practice tests

Scored 10-question sessions with instant feedback and explanations.

LPIC-1 Practice Test 1 — 10 Questions→LPIC-1 Practice Test 2 — 10 Questions→LPIC-1 Practice Test 3 — 10 Questions→LPIC-1 Practice Test 4 — 10 Questions→LPIC-1 Practice Test 5 — 10 Questions→LPIC-1 Practice Exam 1 — 20 Questions→LPIC-1 Practice Exam 2 — 20 Questions→LPIC-1 Practice Exam 3 — 20 Questions→LPIC-1 Practice Exam 4 — 20 Questions→Free LPIC-1 Practice Test 1 — 30 Questions→Free LPIC-1 Practice Test 2 — 30 Questions→Free LPIC-1 Practice Test 3 — 30 Questions→LPIC-1 Practice Questions 1 — 50 Questions→LPIC-1 Practice Questions 2 — 50 Questions→LPIC-1 Exam Simulation 1 — 100 Questions→

Practice by domain

Each domain maps to a weighted exam section. Focus on the domain where you are weakest.

GNU and Unix CommandsDevices, Filesystems and FHSLinux Installation and Package ManagementEssential System Services and NetworkingAdministrative TasksShells, Scripting and Data ManagementSystem Architecture

Practice by scenario

Filter questions by type — troubleshooting, exhibit, drag-and-drop, PBQ, ACLs, OSPF, and more.

Browse scenarios→

Continue studying

All GNU and Unix Commands setsAll GNU and Unix Commands questionsLPIC-1 Practice Hub