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 PracticeA system administrator writes a script that extracts data from a CSV file and inserts it into a database. The script works correctly when run manually but fails when executed by cron. Which environment variable is most likely causing the issue?
Explanation: When a script runs manually, the user's interactive shell inherits a fully populated PATH environment variable that includes directories like /usr/local/bin, /usr/bin, and possibly custom script directories. Cron jobs, however, execute with a minimal environment, and the default PATH for cron is often just /usr/bin:/bin. If the script relies on commands (e.g., mysql, psql, or custom scripts) located outside these directories, cron will fail with a 'command not found' error. Setting the full PATH explicitly inside the script or in the crontab file resolves the issue.
A developer needs to ensure a bash script exits immediately if any command fails, and also prints each command before executing it. Which set of shell options should be used at the beginning of the script?
Explanation: Option A is correct because `set -ex` combines two essential shell options: `-e` (errexit) causes the script to exit immediately if any command returns a non-zero exit status, and `-x` (xtrace) prints each command (after expansion) to stderr before executing it. This is the standard way to achieve both behaviors in a single line, as required by the question.
A script contains the following line: for i in $(cat file.txt); do echo $i; done. The file file.txt contains a single line with multiple words. How many times will the loop execute?
Explanation: The command substitution $(cat file.txt) expands to the content of file.txt, which is a single line with multiple words. The for loop iterates over each word (separated by whitespace) in the expanded string, not over lines. Therefore, the loop executes once per word in the file.
Refer 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: Option B is correct because `ps --sort=-rss` directly sorts the process list by resident set size (RSS) in descending order, using the minus sign prefix to indicate reverse sort. This is a native `ps` feature that avoids piping to `sort`, which can be less reliable due to column alignment issues.
+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 →