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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find , grep james94538 UNIX for Dummies Questions & Answers 3 10-09-2008 09:03 PM
grep, find or awk? netrom UNIX for Dummies Questions & Answers 4 04-09-2008 05:03 PM
grep and find MEllis5 UNIX for Dummies Questions & Answers 1 04-07-2008 08:16 AM
what is wrong in this awk or grep .... manas_ranjan UNIX for Dummies Questions & Answers 2 11-15-2007 05:46 AM
find & grep Anika UNIX for Dummies Questions & Answers 11 02-01-2001 12:19 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-28-2008
djdes22 djdes22 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 7
what i do wrong, find grep rm, help me plz

hello.
i need find folders only with name 2006 and delete.

find /path/to/dir/-07/ -type d | grep 2006 | -exec rm -rf {} \;

and etc doesnt work :\
what i do wrong :?
  #2 (permalink)  
Old 04-28-2008
danmero danmero is online now Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,368
Quote:
Originally Posted by djdes22 View Post
hello.
i need find folders only with name 2006 and delete.

find /path/to/dir/-07/ -type d | grep 2006 | -exec rm -rf {} \;

and etc doesnt work :\
what i do wrong :?
Why you need grep ? Read man find
Code:
find /path/to/dir/-07/ -type d -name "2006"  -exec rm -rf {} \;
  #3 (permalink)  
Old 04-28-2008
djdes22 djdes22 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 7
Quote:
Originally Posted by danmero View Post
Why you need grep ? Read man find
Code:
find /path/to/dir/-07/ -type d -name "2006"  -exec rm -rf {} \;
doesnt work not deleted.

root@des:/media/2008-04-26/des# ls
Deepslauter-Rock_Em_All-(Reissue)-2007-VERiTAS Enjae-Enjae-2006-SMO

root@des:/media/2008-04-26/des# find /media/2008-04-26/des/ -type d -name "2006" -exec rm -rf {} \;

root@des:/media/2008-04-26/des# ls
Deepslauter-Rock_Em_All-(Reissue)-2007-VERiTAS Enjae-Enjae-2006-SMO

Last edited by djdes22; 04-28-2008 at 11:26 AM..
  #4 (permalink)  
Old 04-28-2008
redhead's Avatar
redhead redhead is offline
Registered User
  
 

Join Date: Feb 2002
Location: Denmark
Posts: 58
find /path/to/dir/-07/ -type d -name "*2006*" -exec rm -rf {} \;
  #5 (permalink)  
Old 04-28-2008
djdes22 djdes22 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 7
Quote:
Originally Posted by redhead View Post
find /path/to/dir/-07/ -type d -name "*2006*" -exec rm -rf {} \;
ohh working! BIG thx all
Sponsored Links
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 10:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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