Courseiva
Devices, Filesystems and FHSmediumMultiple ChoiceObjective-mapped

LPIC-1 Devices, Filesystems and FHS Practice Question

A system administrator notices that the /tmp directory is filling up quickly, causing applications to fail. The administrator wants to ensure that files in /tmp are automatically cleaned after a certain period. Which of the following is the best approach without installing additional software?

⚠ Common exam trap

Many candidates confuse the sticky bit (which only prevents deletion by other users) with automatic cleanup, or assume that a brute-force cron job is acceptable, while the correct answer leverages a built-in systemd service that is already present on most modern Linux distributions.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Configure the systemd-tmpfiles service with a configuration file to clean /tmp regularly.

Systemd-based Linux distributions include the systemd-tmpfiles service, which can be configured via files in /etc/tmpfiles.d/ to automatically clean temporary files based on age, size, or other criteria. This approach uses built-in systemd functionality without requiring additional software, and it is the recommended method for managing /tmp cleanup on modern systems.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Add a cron job that runs 'rm -rf /tmp/*' every hour.

    Why it's wrong here

    This is too aggressive and may remove files in use. Also not a standard approach without custom scripting.

  • Install tmpwatch and configure it to clean files older than 1 day.

    Why it's wrong here

    tmpwatch is not installed by default on many distributions; the question specifies without installing additional software.

  • Set the sticky bit on /tmp to automatically delete old files.

    Why it's wrong here

    The sticky bit prevents users from deleting files they don't own; it does not automatically clean old files.

  • Configure the systemd-tmpfiles service with a configuration file to clean /tmp regularly.

    Why this is correct

    systemd-tmpfiles is part of systemd and is available by default; it provides a clean mechanism for temporary file management.

About these practice questions

Courseiva writes every LPIC-1 question from scratch — 527 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.