How To Delete the Contents of a Linux Directory

Ask a question
You may find yourself frustrated if, under Linux, you can't locate the command to erase the contents of a folder without deleting the file read itself.

This FAQ will show you how to do so.

Erasing the Contents of a Linux Folder

Go to the directory, and enter:


rm -rf *  

Alternatively, you can enter:


rm -rf your_directory/*  

Image: © quka - Shutterstock.com

Ubuntu - CodeBlocks does not compile
Problem with sound on EeePC 701