The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find files size 0 within a directory astonmartin Shell Programming and Scripting 3 02-07-2008 04:49 PM
find files and copy into a directory balireddy_77 Shell Programming and Scripting 4 04-27-2007 04:38 AM
Help Using Grep command to Find the string in the files in the root directory Subbu_Angeline AIX 3 01-17-2007 01:45 PM
Files in work directory reverting to root ownership canman UNIX for Dummies Questions & Answers 1 06-16-2005 12:24 PM
find directory with 2 types of files dangral UNIX for Dummies Questions & Answers 2 10-13-2004 02:51 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-05-2006
gkrishnag gkrishnag is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 49
How to find all the log files under the root directory -- Need Info

Hi

I need to find all the log files under the root directory and delete them if necessary, if any one has a sample script who can share with me.

Thanks
  #2 (permalink)  
Old 09-06-2006
RishiPahuja's Avatar
RishiPahuja RishiPahuja is offline
Registered User
  
 

Join Date: Apr 2005
Location: Bangalore, India
Posts: 203
This should do:
find $DIR -name "*.log" -exec rm -rf {} \;
  #3 (permalink)  
Old 09-06-2006
gkrishnag gkrishnag is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 49
Thanks

I have an extension for that.. i need to remove only if needed.. actually i am planning to write a script where that would ask a user to remove yes/no..
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0