As the doctor gone rogue

April 22, 2010

How do I delete a large chunk of file?

Filed under: bash, Wordpress — hypotheses @ 2:17 pm

Posting Source Code « Support — WordPress.com.

This might not be a good way to start a blog, but at least it gets me started about what I would like to do about my blog, and integrate this into part of my everyday work, which is writing some code/program/analysis in genetic epidemiology or statistical genetics. It should be an archive of examples and resources for readers.


## Here's a way to delete a large chuck of files which gives you error that "argument too long"

find .|grep 'merlin.*[(dat)|(freq)|(tbl)|(ped)|(map)]$' | xargs rm

– first the last part of grep enable you to match many types of file extension

– second : xargs allow you to execute any command to a long arguments that you parse to it “one by one”

Advertisements

Create a free website or blog at WordPress.com.