Difficulty: Easy
Correct Answer: rm
Explanation:
Introduction / Context:
Deleting files is a core administrative skill on UNIX and Linux. Unlike some desktop environments that send files to a recycle bin, the rm command permanently removes directory entries. When no other hard links reference the inode and no process keeps the file open, the space is reclaimed.
Given Data / Assumptions:
Concept / Approach:
rm removes directory entries for files and directories (with -r for recursive). It does not ask for confirmation by default, so using -i is safer in interactive sessions. The actual data blocks are freed when no references remain, and the kernel updates filesystem metadata accordingly.
Step-by-Step Solution:
Verification / Alternative check:
Run ls or find to confirm the file is gone. If a process had the file open, lsof can show open handles; space is reclaimed once handles close.
Why Other Options Are Wrong:
a: del is a DOS/Windows command, not standard UNIX.
b: mv moves or renames a file; it does not delete it.
d: remove is not the standard user command; rm is.
e: Not applicable because rm is correct.
Common Pitfalls:
Accidental use of wildcards, removing files as root without prompts, and attempting to delete without write permission on the parent directory. Consider aliases like rm -i to add a safety net.
Final Answer:
rm
Discussion & Comments