Bird
0
0

Why does Linux often read files in nearly constant time when using commands like cat repeatedly on the same file?

easy📝 Conceptual Q1 of 15
Linux CLI - Viewing and Editing Files
Why does Linux often read files in nearly constant time when using commands like cat repeatedly on the same file?
ABecause the file data is cached in RAM after the first read
BBecause <code>cat</code> compresses the file before reading
CBecause Linux reads files directly from disk every time
DBecause the file size is automatically reduced after first read
Step-by-Step Solution
Solution:
  1. Step 1: Understand file caching

    Linux caches file data in RAM after the first read to speed up subsequent reads.
  2. Step 2: Effect on repeated reads

    When cat reads the file again, it accesses the cached data, avoiding disk I/O delays.
  3. Final Answer:

    Because the file data is cached in RAM after the first read -> Option A
  4. Quick Check:

    File caching reduces disk reads [OK]
Quick Trick: Linux caches files in RAM after first read [OK]
Common Mistakes:
MISTAKES
  • Assuming cat compresses files
  • Believing Linux always reads from disk
  • Thinking file size changes after reading

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes