Courseiva
hardMultiple Choice

220-1202 Practice Question: That a script they run daily now fails with 'Text…

A user reports that a script they run daily now fails with 'Text file busy' error. The script is located on an NFS mount. Which command will show if the script is currently being used by another process?

⚠ Common exam trap

The A+ exam often tests the distinction between `lsof` and `fuser`; the trap here is that candidates assume `fuser` is sufficient, but `fuser` may not report processes that have the file mapped for execution (text segment) on NFS mounts, whereas `lsof` reliably shows all open file descriptors and memory mappings.

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

✓

lsof /path/to/script

`lsof /path/to/script` lists all processes that have the file open, including those holding it for execution. The 'Text file busy' error occurs when a process is executing the script (the text segment is mapped), and `lsof` can detect this by showing the file descriptor or memory mapping for the running process.

Answer analysis

Option-by-option breakdown

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

  • ✗

    fuser /path/to/script

    Why it's wrong here

    fuser also shows processes using a file, but it is less commonly used than lsof; it is correct but not the most standard.

  • ✗

    ps aux | grep script

    Why it's wrong here

    This shows running processes with 'script' in the name, but does not specifically show if the file is open.

  • ✓

    lsof /path/to/script

    Why this is correct

    lsof lists all open files and the associated processes; it will show if the script is in use.

  • ✗

    strace -p $(pgrep script)

    Why it's wrong here

    strace traces system calls, not a quick check for open files.

About these practice questions

Courseiva writes every 220-1202 question from scratch — 687 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 220-1202 practice question is part of Courseiva's free CompTIA 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 220-1202 exam.