View Single Post

  #1 (permalink)  
Old 10-25-2007, 01:51 PM
vivekv vivekv is offline
Junior Member
User
 
Join Date: Sep 2007
My distro: CentOS
Posts: 16
Rep Power: 0
vivekv is on a distinguished road
Default A script for Removing all the files inside a folder and its sub folder

Hi

I would like to do this on my account

/home/user
/home/user/www/folder
/home/user/www/folder/a
/home/user/www/folder/b
/home/user/www/folder/c

Files
/home/user/www/folder/a/1.zip
/home/user/www/folder/b/2.tar
/home/user/www/folder/c/4.mp3

I would like to remove all the files inside
/home/user/www/folder/

But the directory must be there...

The command
Code:
rm -rf
will remove the folder also.

How do I remove only files?

Thank you.
Reply With Quote