Category: Linux Terminal

Added: 15th of September 2018

Updated On: 30th of January 2021

Viewed: 1635 times

Remove files and folders from inside directory on Linux

This article was rechecked and updated on 30/01/21

To remove all files and folders from inside a directory open your terminal and enter the following command

rm -rf /home/username/folder_name/*


To remove the folder after deleting all the files and folders enter the following command
rm -rf /home/username/folder_name


Remember to replace username with your own username, and as always be careful.

Other Tips & Tutorials

Linux Terminal

Kill multiple processes using the pkill command in Linux

Posted: 5th of January 2021

Views: 150

Linux Terminal

Display free memory using the terminal in Linux

Posted: 17th of December 2020

Views: 198

Linux Terminal

Using mlocate to find files by name, extension using the terminal in Linux

Posted: 27th of November 2020

Views: 196

Linux Terminal

Capture screenshots of websites using cutycapt in different formats using the terminal in Ubuntu and Ubuntu based distributions

Posted: 15th of November 2020

Views: 262

Linux Terminal

Display a calendar in the terminal

Posted: 6th of November 2020

Views: 230

Linux Terminal

Create a simple cronjob in Linux

Posted: 20th of October 2020

Views: 333

Linux Terminal

Create a new folder and file using the mkdir and touch commands using the terminal in Linux

Posted: 16th of August 2020

Views: 372

Linux Terminal

Convert a PDF document to text or html using pdftotext, pdftohtml in Linux using the terminal

Posted: 3rd of August 2020

Views: 555

Linux Terminal

List files in a directory using the ls command

Posted: 22nd of July 2020

Views: 376

Linux Terminal

How to access HP Linux Imaging and Printing System set up on Ubuntu using the terminal

Posted: 13th of November 2019

Views: 997