Which command is used to delete a file in Linux?

Explore the Linux Fundamentals Test. Revise with flashcards and multiple choice questions, each with hints and explanations. Prepare thoroughly for your Linux exam!

The command used to delete a file in Linux is "rm." This command stands for "remove" and is the standard utility used for removing files and, when combined with specific options, directories too. When you run "rm" followed by the name of the file you wish to delete, it removes that file from the filesystem, making it no longer accessible.

The other options represent commands that either do not exist in standard Linux practice for file deletion or have different purposes. For instance, while "delete" might sound intuitive, it is not a recognized command in Linux. "rmdir" is specifically aimed at removing empty directories, not files, and "remove" is often confused with "rm" but is not an actual command in Linux. Hence, the most appropriate and widely accepted command for deleting files is indeed "rm."

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy