Skip to content
April 9, 2012 / doganay

HOW TO EMPTY MULTIPLE FILES USING WILDCARD (CLEAR CONTENTS)

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Hi,

You can empty some files using the same wildcard:

### This command clears data in your files. Please be careful and take your own risk !

$ for i in your_wilcard*; do dd if=/dev/null of=$i; done

This command also does the same thing, but 1st one is my fav 🙂

$ find . -name "your_wildcard*" -exec basename {} \; | awk '{print "> "$1}' > a.sh
$ .  ./a.sh

try and pray 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: