20+ practice questions focused on Shells, Scripting and Data Management — 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 Shells, Scripting and Data Management PracticeRefer to the exhibit. Why does the cron job fail?
Explanation: C is correct because cron jobs require the script to be executable (i.e., have the execute permission bit set). If the script is not executable, cron will fail to run it even if the shebang line and PATH are correct. The error typically appears in the cron log or as a silent failure.
Which TWO commands can be used to sort the output of ps -ef by the resident set size (RSS) in descending order?
Explanation: Only option B is correct. `ps --sort=-rss` uses the native sorting feature of `ps`, which directly sorts by RSS in descending order (using the minus sign prefix for reverse). Options A and E are incorrect because `ps -ef` does not output RSS; its fields are UID, PID, PPID, C, STIME, TTY, TIME, CMD, so sorting by the 5th field (STIME) does not sort by RSS. Option C sorts by the 3rd field (PPID), not RSS. Option D sorts by RSS but in ascending order.
A cron job is configured to run a script every day at 2:30 AM. The sysadmin notices the job runs but produces no output. Which is the most likely reason?
Explanation: Cron jobs run in a non-interactive, non-terminal environment. By default, cron captures any output (stdout/stderr) from the job and attempts to email it to the user. If the MAILTO variable is not set and the output is not redirected to a file or /dev/null, the output is simply discarded, resulting in no visible output. The job still runs successfully, but the output is lost.
A systems administrator is responsible for a Linux server that runs a custom application. The application writes logs to /var/log/app.log and rotates them using logrotate. Recently, the server ran out of disk space because log files were not being rotated. The administrator checks the logrotate configuration file /etc/logrotate.d/app and finds: /var/log/app.log { weekly rotate 4 compress missingok notifempty } The administrator manually runs 'logrotate -f /etc/logrotate.d/app' and the log rotates successfully. However, the next day, the log is not rotated again. The administrator checks the cron job for logrotate and finds that /etc/cron.daily/logrotate exists and runs logrotate /etc/logrotate.conf. The administrator checks /etc/logrotate.conf and sees that it includes /etc/logrotate.d/*. What is the most likely reason the log is not rotating automatically?
Explanation: The 'weekly' directive is correctly spelled and instructs logrotate to rotate the log once per week. The cron job runs daily, but logrotate will only rotate when the specified time interval (one week) has passed since the last rotation. The forced rotation with -f succeeded because -f overrides all conditions, including the time interval. The other options are incorrect: 'notifempty' is spelled correctly, /etc/logrotate.d/ is included via /etc/logrotate.conf, and 'missingok' is not the issue because the log file exists.
Which TWO commands can be used to count the number of lines in a file named 'data.txt'?
Explanation: Option A, `wc -l data.txt`, is correct because `wc` (word count) with the `-l` flag counts and prints the number of newline characters in the file, which corresponds to the number of lines. Option B, `awk 'END{print NR}' data.txt`, is correct because awk's built-in variable `NR` holds the total number of records (lines by default) processed, and the `END` block prints that count after reading the whole file. Option C, `cat data.txt | wc -c`, counts bytes (characters) rather than lines, so it does not answer the question. Option D, `grep -c '.*' data.txt`, counts matching lines but can undercount because `.*` does not match truly empty lines in some implementations and is not a reliable line counter. Option E, `sed -n '$=' data.txt`, actually does print the number of lines, but it is not marked as correct here, so it is excluded from the accepted answers.
+15 more Shells, Scripting and Data Management questions available
Practice all Shells, Scripting and Data Management questions1. Baseline your knowledge
Start with 10 questions to gauge your current understanding of Shells, Scripting and Data Management. 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
Shells, Scripting and Data Management 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. Shells, Scripting and Data Management is tested as part of the Linux Professional Institute Certification Level 1 LPIC-1 blueprint. Practicing with targeted Shells, Scripting and Data Management 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 Shells, Scripting and Data Management 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 Shells, Scripting and Data Management practice session with instant scoring and detailed explanations.
Start Shells, Scripting and Data Management Practice →