Quick Answer: How to Remove Directory Linux?
Contents

How do I delete a directory in Linux?

To remove a directory that contains other files or directories, use the following command.

In the example above, you would replace “mydir” with the name of the directory you want to delete.

For example, if the directory was named files, you would type rm -r files at the prompt.

How do I remove a directory in Ubuntu?

The “rm” command by itself will remove individual files, while adding the “recursive” option will make the command delete a folder and everything within it. Click on the Ubuntu logo in the upper-right corner of your screen. Type “Terminal” into the text field that will appear below your cursor.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest