OSCP Linux Practice Exam

Access More Questions
To delete a file, what permissions do you need?
Correct Answer:
Write and execute for the directory
Explanation:
Deleting a file is a change to the directory’s contents, not a change to the file itself. To remove an entry, you must be able to modify the directory, which requires write permission on the directory. You also need execute permission on the directory to access or traverse it and reach the entry you want to delete. The file’s own permissions don’t control whether you can delete it. (Note: a sticky bit on a directory, common on shared dirs like /tmp, can restrict deletion of files owned by others even if you have write/execute on the directory.) So, the necessary permissions are write and execute on the directory.

Access more questions from this quiz

Continue to OSCP Linux Practice Exam for more practice questions and the full quiz experience.

Access More Questions