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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
11-23-2005, 05:13 AM
|
#1
|
|
Member
Registered: Nov 2005
Location: Italy
Posts: 36
Rep:
|
Remove ALL files from specific Directory
How can I Remove ALL files in a specific Directory ?
grazie,
Bianchi
|
|
|
|
11-23-2005, 05:39 AM
|
#2
|
|
Senior Member
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284
Rep:
|
Code:
rm /path/to/directory/*.*
will remove all files, whilst leaving any sub-directories alone. If you wanted to remove the whole directory + sub directories, "rm -rf /path/to/directory/" would do it.
|
|
|
|
11-23-2005, 05:40 AM
|
#3
|
|
LQ Newbie
Registered: Oct 2005
Distribution: Fedora Core 3
Posts: 20
Rep:
|
Do you mean other than by doing :
$ rm -rf <dir-path>/*
|
|
|
|
11-23-2005, 05:40 AM
|
#4
|
|
Member
Registered: Nov 2005
Location: Italy
Posts: 36
Original Poster
Rep:
|
I mean in 'c' + wxwidgets 
|
|
|
|
11-23-2005, 07:16 AM
|
#5
|
|
Member
Registered: Nov 2005
Location: Italy
Posts: 36
Original Poster
Rep:
|
Found myself :
wxString f = wxFindFirstFile("/home/project/*.*");
while ( !f.empty() )
{
wxRemoveFile ( f );
f = wxFindNextFile();
}
|
|
|
|
11-23-2005, 08:30 AM
|
#6
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
rm *.* will not work.
that's DOS speak. It will only remove files with a dot in them.
|
|
|
|
11-23-2005, 08:47 AM
|
#7
|
|
Member
Registered: Nov 2005
Location: Italy
Posts: 36
Original Poster
Rep:
|
Thats ok with me , the files have suffix
|
|
|
|
11-23-2005, 02:07 PM
|
#8
|
|
Senior Member
Registered: May 2005
Location: boston, usa
Distribution: fc-12/ fc-11-live-usb/ aix
Posts: 2,672
|
that brings up a moral issue.
i consider it good practice to put an extension in all my files. eventhough it isn't a standard (moreover an m$ windoze standard).
also filenames without spaces, punctuation .except for dot., capitals, '_'s... makes my life easier
what is proper file naming convention
|
|
|
|
11-23-2005, 02:27 PM
|
#9
|
|
Senior Member
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284
Rep:
|
Quote:
rm *.* will not work.
that's DOS speak. It will only remove files with a dot in them.
|
Struggling from too much beer last night, too little sleep, and too many OS' at work in my defence  But, depending on what you were removing, it will still work, obviously providing they had an extension...
Last edited by fouldsy; 11-23-2005 at 02:28 PM.
|
|
|
|
11-23-2005, 11:27 PM
|
#10
|
|
Member
Registered: Nov 2005
Location: Italy
Posts: 36
Original Poster
Rep:
|
All of my files which I need to remove are
DOS named , so they contain "." .
so this solution is good for my case ,
if anyone else dont have the same problem , please
change it , so it will suite well.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:59 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|