Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Have you been searching the internet for a guide that comprehensively demonstrates how to delete a folder in the Ubuntu Linux-based OS? You should read this guide – it features various methods to delete a folder in Ubuntu Linux.

Before proceeding, it is important to mention that this guide was written using the Ubuntu 22.04 LTS Linux-based OS. Due to this, the procedures provided may be slightly different if you use other versions of the Ubuntu Linux OS.

Option 1: Delete a Folder Through the GUI

Most distributions of the Linux operating system offer a GUI (Graphical User Interface), including the Ubuntu operating system. Hence, through the file manager in the GUI, users should be able to delete a folder.

To delete a folder on your Ubuntu Linux-based computer via the GUI, follow the procedures and screenshot images below.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. On the Ubuntu dock, click the Show Applications button. Then, input “files” in the search field and select the Files icon from the search result.
If available, you can also click the Files icon on the Ubuntu dock to open the file manager.
Delete A Folder In Linux Through The GUI
  1. When the file manager opens, click the search icon at the top and input the name of the folder you want to delete in the search field. For this demonstration, I want to delete a folder named “Sample.”
  1. Now, right-click the folder from the search result. Finally, left-click Move to Trash from the options that appear to delete the folder.
Alternatively, select the folder, then click the Delete button on your keyboard.
Delete A Folder In Linux Through The GUI
The procedures mentioned in this section will not permanently delete a folder. Rather, it will move the folder to the trash, where it can be restored or permanently deleted.

Hence, read our How to Empty Trash in Ubuntu article to learn how to permanently delete all the folders and files in your Ubuntu computer’s trash folder. Alternatively, go through the other section below to learn how to permanently delete a folder on your Ubuntu Linux-based PC via the terminal.

Option 2: Delete a Folder via the Terminal

Another method to delete a folder on your Ubuntu Linux-based computer is through the terminal using the rm command. In fact, unlike the method discussed above, this method will permanently delete the folder on your computer.

Popular on Amazon
Linux Commands Cheat Sheet Chart Poster Linux Quick Reference (8) Canvas for Bedroom Living Room Decor 08x12inch(20x30cm) Unframe-style
  • NOTE: All poster prints may vary slightly from what you see on your screen due to the resolution and colour profile of your device. These prints look AMAZING when displayed in a frame or straight on the wall.
  • QUALITY: The poster is printed on canvas. It is waterproof,moisture proof and high tensile strength.The poster has rich printing color and fine texture.
  • DECORATION: TOP MODERN! Really eye-catching! Ideal for all modern graphic & photographic designs. Your wall / room gets very special lightness & beauty.
  • FEATURES: We are good at making canvas posters, making high-quality posters is our pursuit, Different from paper posters, canvas posters have better quality and longer shelf life.
  • If you are not satisfied with our print paintings, please feel free to contact us.

So, to delete a folder on your Ubuntu Linux-based computer through the terminal, follow the procedures below.

  1. Open the terminal on your Ubuntu computer by right-clicking any free space on the desktop and selecting Open in Terminal from the displayed options. Alternatively, you can also use the Ctrl + Alt + T keyboard shortcut to open the terminal in Ubuntu.
Delete A Folder In Linux Via Terminal
  1. When the terminal opens, execute the command below. However, replace “folder-name” with the exact name of the folder you want to delete.
find / -name "folder-name" -exec rm -r {} +

For example, if I want to delete a folder named “Sample” on my Ubuntu PC, below is what the command should look like.

find / -name "Sample" -exec rm -r {} +
  1. Consequently, the command will find and permanently delete the folder on your computer.
Delete A Folder In Linux Via Terminal

Frequently Asked Questions

1. How do I delete a folder in the Linux terminal?

To delete a folder via the Linux terminal, type “find / -name “folder-name” -exec rm -r {} +” in the terminal and press the enter key. However, replace “folder-name” in the command with the exact name of the folder you want to delete.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
2. Can I delete a folder that is currently in use in Ubuntu?

No, you cannot delete a folder that is currently in use on your Ubuntu computer. In order to delete a folder in the Ubuntu operating system, the folder must not be active.

Hence, you will need to stop every program or process using the folder before making an attempt to delete the folder.

Also popular on Amazon
Linux Commands Cheat Sheet Chart Poster Linux Quick Reference (9) Canvas for Living Room Bedroom Decor 12x18inch(30x45cm) Unframe-style
  • NOTE: All poster prints may vary slightly from what you see on your screen due to the resolution and colour profile of your device. These prints look AMAZING when displayed in a frame or straight on the wall.
  • QUALITY: The poster is printed on canvas. It is waterproof,moisture proof and high tensile strength.The poster has rich printing color and fine texture.
  • DECORATION: TOP MODERN! Really eye-catching! Ideal for all modern graphic & photographic designs. Your wall / room gets very special lightness & beauty.
  • FEATURES: We are good at making canvas posters, making high-quality posters is our pursuit, Different from paper posters, canvas posters have better quality and longer shelf life.
  • If you are not satisfied with our print paintings, please feel free to contact us.
3. How can I move a folder to trash in Ubuntu?

Follow the procedures below to learn how to move a folder to trash on your Ubuntu computer.
a) On the Ubuntu dock, click the Show Applications button.
b) Then, input “files” in the search field and select the Files icon from the search result.
c) When the file manager opens, click the search icon at the top and type the name of the folder you want to move to the trash in the search field.
d) Now, right-click the folder from the search result and left-click Move to Trash from the options that appear.

4. Can I recover a deleted file in Ubuntu?

That depends on the method you use to delete the file. To be more specific, if you delete the file by moving it to the trash, you can easily recover it from the trash folder.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Conclusion

Deleting unnecessary folders frees up storage space on your Ubuntu Linux-based computer. As a matter of fact, it makes your computer operate faster and smoother.

Gladly, this guide demonstrated multiple ways to delete a folder in the Ubuntu Linux operating system. To be precise, we learned how to perform this task through the Ubuntu GUI (Graphical User Interface).

Procedures to delete a folder via the Linux terminal were also provided in this guide.

I sincerely hope this guide and the methods included were helpful to you. If they were helpful to you, click on “Yes” beside the “Was this page helpful” question below.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You may also express your thoughts and opinions by using the “Leave a Reply” form at the bottom of this page.

Finally, visit our Linux how-to page to get more Linux guides.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.