UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 21st, 2005, 02:20 PM
bilgeyts bilgeyts is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 5 bilgeyts User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m 23 sec
Reputation Power: 0
deleting files

hi,
i need your help again..
i have a directory named as 'projects' under root directory.
now, i want to remove *.o (all files with extension.o) in the "projects" directory and in its subdirectories..
for example
/projects/hw1/myhw.o
/projects/hw2/exercise/56.o
...
don't want to remove them one by one..

which command line should i write to remove *.o when working on the root directory..

Reply With Quote
  #2  
Old October 21st, 2005, 02:24 PM
stdunbar stdunbar is online now
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,709 stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 17 h 44 m 48 sec
Reputation Power: 338
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
First if you really mean this as Unix help you need to learn to lean your slashes to the right, not left - this isn't Windows.

Next, you'll want to do a "man find" for all possible options but the way I do it would be:

Code:
find . -name '*.o' -exec rm -f {} \;


though there are other ways.
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
  #3  
Old October 21st, 2005, 02:56 PM
bilgeyts bilgeyts is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 5 bilgeyts User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m 23 sec
Reputation Power: 0
Quote:
Originally Posted by stdunbar
First if you really mean this as Unix help you need to learn to lean your slashes to the right, not left - this isn't Windows.

Next, you'll want to do a "man find" for all possible options but the way I do it would be:

Code:
find . -name '*.o' -exec rm -f {} \;


though there are other ways.


thanks for your help..
sorry about the slashes.. i have corrected them..

Reply With Quote
  #4  
Old October 24th, 2005, 07:25 AM
Oraly Oraly is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: Stavanger
Posts: 83 Oraly User rank is Lance Corporal (50 - 100 Reputation Level)Oraly User rank is Lance Corporal (50 - 100 Reputation Level)Oraly User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 20 h 13 m 24 sec
Reputation Power: 8
Or you could do rm -R *.o
Be warned thoug, the -R option is dangerous if misused. If you do rm -Rf *.* by mistake, you delete everything!

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > deleting files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate 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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway