LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-04-2005, 10:41 AM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,615

Rep: Reputation: 47
need a script to delete all files from a directory and all subdirectories


hi

I need a perl script or bash to delete ALL files from a directory
and from ALL subdirectories, but it should NOT delete any directories & subdirectories.

greetings
cccc

Last edited by cccc; 06-08-2005 at 07:38 PM.
 
Old 03-04-2005, 10:54 AM   #2
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 45
hi there,

not the complete solution but i give you the direction...
Code:
find /your_path/ -type f -print | rm -f -
i used print cause you can check before.

regards

slackie1000
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script to delete files c0d3 Programming 9 12-05-2004 10:45 PM
How to make JHEAD work on all subfolders within a folder SupaDucta Linux - Newbie 0 11-26-2004 06:02 PM
Delete old files and folders Script? AsteX Linux - General 4 11-11-2004 06:26 PM
changeing permissions for a folder + subfolders and files ? YBA^[x] Slackware 7 08-06-2004 04:07 AM
Script on linux to delete certain files ForumKid Linux - General 2 06-22-2002 01:09 PM


All times are GMT -5. The time now is 05:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration