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…
Question
Which permission bit allows a user to delete a file?
Options
- ARead
- BWrite
- CExecute
- DSetUID
How the community answered
(37 responses)- A3% (1)
- B92% (34)
- C5% (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
Community Discussion
No community discussion yet for this question.