20+ practice questions focused on GNU and Unix Commands — one of the most tested topics on the Linux Professional Institute Certification Level 1 LPIC-1 exam. Each question includes a detailed explanation so you learn why the right answer is correct.
Start GNU and Unix Commands PracticeRefer 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?
Explanation: The first sed command uses the -i flag to edit the file in place without a backup, and the substitution 's/setting1=default/setting1=production/' changes the existing setting. The second sed command uses the 'a' (append) command after the line matching '^include ' to add the new line 'setting2=value' after it, also with -i to avoid creating a backup.
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?
Explanation: The issue is that with daily rotation, the delaycompress directive delays compression by only one rotation (one day). This means that rotated logs are compressed after one day, not after the desired 7 days. To meet the requirement that logs older than 7 days are compressed, the rotation frequency should be changed to weekly. With weekly rotation, delaycompress delays compression by one week, so logs younger than 7 days remain uncompressed and the most recent week's logs are available for troubleshooting.
Order the steps to recover a forgotten root password on a Linux system.
Explanation: Recovery involves booting into a shell with root access, remounting read-write, and changing the password.
Match each device file naming pattern to its device type.
Explanation: Common Linux device naming conventions: /dev/sdX for SATA/SCSI, /dev/hdX for IDE, /dev/ttySX for serial ports, /dev/srX for optical drives, /dev/nvmeXnY for NVMe. Be cautious not to confuse with floppy (/dev/fdX) or other types.
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?
Explanation: It uses `find` with `-mtime 0` to locate files modified within the last 24 hours, then pipes each found file to `grep -l` to print only filenames containing 'error'. The `-exec` option runs `grep` on each file individually, and `-l` ensures only matching filenames are output, not the matching lines.
+15 more GNU and Unix Commands questions available
Practice all GNU and Unix Commands questions1. Baseline your knowledge
Start with 10 questions to gauge your current understanding of GNU and Unix Commands. This tells you whether you need a concept refresher or just practice.
2. Review every explanation
For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.
3. Focus on exam traps
GNU and Unix Commands questions on the LPIC-1 frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.
4. Reach 80% consistently
Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.
The exact number varies per candidate. GNU and Unix Commands is tested as part of the Linux Professional Institute Certification Level 1 LPIC-1 blueprint. Practicing with targeted GNU and Unix Commands questions ensures you can handle any format or difficulty that appears.
Yes. Courseiva provides free LPIC-1 practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.
Difficulty is subjective, but GNU and Unix Commands is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.
Launch a full GNU and Unix Commands practice session with instant scoring and detailed explanations.
Start GNU and Unix Commands Practice →