Linux is one of the complicated operating systems. So, how you can remove directory and contents in Linux using command? Let’s learn to remove Linux directory and contents.
You can remove or delete all files in a directory using the rm command.
Today you will learn the easiest way to remove directories on Linux.
Table of Contents
How to Remove Linux Directory and Contents
For example, today in this article we will delete a directory completely using rm command. We think that the directory is: /home/technewsal/videos
So, let’s remove this Linux directory completely.
- Firstly, open the terminal application
Then to remove all files in this “/home/technewsal/videos” directory simply run this command.
- Run this command: rm /home/technewsal/videos/*

This will delete all files in the directory.
- Lastly, to remove all subdirectories and it’s contents run this command.

rm -r /home/technewsal/videos/*
- If you want to see which file is deleting or which is not deleting

Simply run this command: rm -v /home/technewsal/videos/*
- Now if you want to check and verify is there any files in that directory

Run this command: ls – /home/technewsal/videos
- By the way, if you see some files in that directory after deleting it.
You should run this command: rm -rfv /home/technewsal/videos/

Hopefully, this will remove all files in the directory “/home/technewsal/videos”.
To clarify and to be oversure it removed or not run this command: ls – /home/technewsal/videos
Editor’s Recommend
- Apple’s iOS 14 Brings More Featureful Podcast App with “For You” Tab
- Apple’s iOS 14 Brings More Featureful Podcast App with “For You” Tab
- Best 23 Games Like Stardew Valley That You Didn’t Play Before
- How To Use Banglalink Free Internet (Unlimited Access)
- SEMrush Review: Is It Worth in 2020? An Honest Reviews
- WhatsApp Dark Mode The Proven Ways To Enable In 2020
- Bash tips for everyday at the command line
How to Remove Linux Directory and Contents Command Explained
Here I use mostly rm command and rfv command. Therefore, Let’s know what these commands mean.
Some Most Asked FAQ’s
What Is Mean by rm on Linux?
rm stands for remove and this is a command to remove something especially computer files, directories, and symbolic links, etc.
How to Use rm Command on Linux to Remove or Delete Directories?
Open the terminal run: rm /directory name/ This will remove everything on that directory.
What Is Mean by rfv Command on Linux
r means remove directory and f for force options and lastly, v means verbose option.
Conclusion
I hope now you can remove or delete any directory or files using the rm command. Hopefully, you enjoy our article “Ultimate Guide to Remove Linux Directory and Contents”.
If you are a new visitor then don’t forget to bookmark our site and subscribe to our newsletter for learning everything about technology.
At last, let me know your opinion in the comment section. And to get some amazing tech articles like this enter your email below to get it into your inbox quickly.
Please don’t be cheap to share this article on your social profile.
Thank me 💔 by sharing this article.