Courseiva
Essential CommandseasyMultiple ChoiceObjective-mapped

LFCS Essential Commands Practice Question

A system administrator needs to find all files in /var/log that have been modified in the last 24 hours. Which command accomplishes this?

⚠ Common exam trap

Many exam-takers confuse `-mtime -1` (modified less than 24 hours ago) with `-mtime 1` (modified between 24 and 48 hours ago) or `-mtime 0` (modified exactly 24 hours ago), leading candidates to pick the wrong numeric argument.

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

find /var/log -mtime -1

`find /var/log -mtime -1` finds files modified less than 1 day ago (i.e., within the last 24 hours). The `-mtime` option with a negative number (`-1`) matches files whose content was modified less than n*24 hours ago, which is exactly what the question requires.

Answer analysis

Option-by-option breakdown

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

  • find /var/log -mtime 0

    Why it's wrong here

    Finds files modified exactly 0 days ago (current day), not within the last 24 hours.

  • find /var/log -newer /var/log/syslog

    Why it's wrong here

    Compares against a specific file, not a time range.

  • find /var/log -mtime -1

    Why this is correct

    Correctly finds files modified less than 1 day ago, i.e., within the last 24 hours.

  • find /var/log -mtime 1

    Why it's wrong here

    Finds files modified exactly 1 day ago, not within the last 24 hours.

About these practice questions

This LFCS question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.