The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
A Batch job to delete files from various directories guruparan18 Shell Programming and Scripting 3 05-10-2008 01:31 PM
need to find last character in each line in all files dbsurf Shell Programming and Scripting 7 01-24-2008 06:35 AM
Find files including subdirectory and Delete thepurple Shell Programming and Scripting 1 10-04-2007 03:57 AM
Find files which contain a null character Bab00shka UNIX for Dummies Questions & Answers 5 12-16-2005 07:41 AM
Schedule a Batch file to delete files at particular intervals Indom Windows & DOS: Issues & Discussions 6 02-04-2004 09:57 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-30-2006
Registered User
 

Join Date: Apr 2006
Posts: 24
batch delete using find, files with # character

UPDATE: Sorry, disregard this.

It did work, I made a mistake; I just shouldn't have been using maxdepth.

I do think it is good to know, however, that

find | grep '#' | xargs rm

will "clean up" funnily named files in a directory. Of course, some of those funnily named files are there for a reason so use with care...

************************

I want to delete files containing #.

find -maxdepth 1 | grep '#'

gives me the files I want to delete, but when I try piping this into xargs with

find -maxdepth 1 | grep '#' | xargs rm

I get

rm: missing operand.

Is there some way I can get batched delete of files with special chars?

Thanks!

Last edited by tphyahoo; 05-30-2006 at 09:11 AM.
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0