Delete a directory and files from a Linux system

Here is how you delete files and folders or directories from Linux based operating systems in one simple step rm -r -f (followed by the directory name).

Such a simple command.

First you’ll need to be logged in with root access, or use sudo rm -r -f (then the directory name)

The rm is short for ‘remove’

-r and -f (followed by the folder name) will delete the folder/directory and all its contents (including all internal files and directories) without prompt.

Fair warning: there is no prompt. There is no coming back. Double-check you’re entering the folder/directory you really want removed.

Was this of value to you? If so and you feel the desire: Buy Me A Coffee

Got a question? Want to know more?

Please enter your name.
Please enter a message.
Please check the captcha to verify you are not a robot.