Difficulty: Easy
Correct Answer: ls -t
Explanation:
Introduction / Context:
Sorting by modification time is a frequent need when investigating logs, build artifacts, or recent changes. The ls command provides a flag to order entries by their last modification time so the newest items appear first, improving situational awareness on busy systems.
Given Data / Assumptions:
Concept / Approach:
Use ls -t to sort by modification time descending (newest first). Combine with -l for detailed listings or -r to reverse the sort (oldest first). For human-readable timestamps and sizes, add -h where supported.
Step-by-Step Solution:
Verification / Alternative check:
Compare output of ls -t with stat for specific files to confirm ordering by modification time (mtime).
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
ls -t.
Discussion & Comments