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.

HomeCertificationsLPIC-1TopicsShells, Scripting and Data Management
Free · No Signup RequiredLPI · LPIC-1

LPIC-1 Shells, Scripting and Data Management Practice Questions

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 Practice

Exam Domains

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

Study Tools

Practice TestMock ExamFlashcardsAll Topics

Sample Shells, Scripting and Data Management Questions

Practice all 20+ →
1.

A 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?

A.SHELL
B.LANG
C.HOME
D.PATH

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.

2.

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?

A.set -ex
B.set -e
C.set -vx
D.set -ux

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.

3.

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?

A.Equal to the number of lines in the file
B.Equal to the number of words in the file
C.Once
D.The loop will not 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.

4.

Refer to the exhibit. Why does the cron job fail?

A.The cron job lacks the PATH environment variable.
B.The script is owned by root, but the cron job runs as a different user.
C.The script is not executable.
D.The script lacks a shebang line.

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.

5.

Which TWO commands can be used to sort the output of ps -ef by the resident set size (RSS) in descending order?

A.ps -ef | sort -k5,5 -rn
B.ps --sort=-rss
C.ps -ef | sort -k3 -rn
D.ps --sort=rss

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 questions

How to master Shells, Scripting and Data Management for LPIC-1

1. 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.

Frequently asked questions

How many LPIC-1 Shells, Scripting and Data Management questions are on the real exam?

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.

Are these LPIC-1 Shells, Scripting and Data Management practice questions free?

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.

Is Shells, Scripting and Data Management one of the harder LPIC-1 topics?

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.

Ready to practice?

Launch a full Shells, Scripting and Data Management practice session with instant scoring and detailed explanations.

Start Shells, Scripting and Data Management Practice →

Topic Info

Topic

Shells, Scripting and Data Management

Exam

LPIC-1

Questions available

20+