nerdexam
LPI

303-300 · Question #30

Which permission bit allows a user to delete a file?

The correct answer is B. Write. Write permission (B) controls the ability to delete a file because deletion is fundamentally a write operation - it modifies the directory that contains the file by removing the file's entry from it. Read (A) only allows viewing a file's contents; you can read a file all day…

Access Control

Question

Which permission bit allows a user to delete a file?

Options

  • ARead
  • BWrite
  • CExecute
  • DSetUID

How the community answered

(37 responses)
  • A
    3% (1)
  • B
    92% (34)
  • C
    5% (2)

Explanation

Write permission (B) controls the ability to delete a file because deletion is fundamentally a write operation - it modifies the directory that contains the file by removing the file's entry from it.

  • Read (A) only allows viewing a file's contents; you can read a file all day without being able to remove it.
  • Execute (C) allows running a file as a program or traversing a directory; it has no bearing on deletion.
  • SetUID (D) is a special bit that runs an executable with the owner's privileges rather than the caller's - it's unrelated to deletion.

Memory tip: Think of a directory as a list. Write permission on a directory means you can edit that list - adding names (creating files) or crossing them out (deleting files). If you can't write the list, you can't erase anything from it.

Topics

#file-permissions#directory-write#unix-permissions#access-control

Community Discussion

No community discussion yet for this question.

Full 303-300 Practice