Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'no need to grep' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
no need to grep
Authored by: mkhaw on Jan 30, '03 10:42:53AM

The "grep" in the pipeline can be eliminated:

find . -name .DS_Store -print | xargs rm

you could also use the following to avoid a pipe,

find . -name .DS_Store -exec rm

but it's likely to be slower as it runs a new instance of "rm" for each file found. Generally I find that "find ... -print | xargs ..." is more efficient than the equivalent "find ... -exec ..."



[ Reply to This | # ]
no need to grep
Authored by: wmscyclone on Jan 30, '03 11:43:59AM

If you're in the default tcsh, just use

find . -name .DS_Store -delete

and it will delete all the .DS_Store files found in that directory and all of it's subdirectories. If you're really worried about it first run

find . -name .DS_Store -print

to get a list of all the .DS_Store files, then use the -delete option to nuke them all.



[ Reply to This | # ]