Tuesday, July 24, 2012

Empty out multiple file contents all at once


There are various ways to do so - BUT below is what I found a quicker / shorter and very precise.


#echo FileNames | xargs -n1 cp /dev/null

In my case I was trying zip out an archive keeping apache log file name along with other important confg files  BUT without their(apache logs)  heavy content inside them - the data which is already stale for me.

#echo ws*_access.log  | xargs -n1 cp /dev/null

-DK

No comments:

Post a Comment

RCA - Root Cause Analysis

An important step in finding the root causes of issues or occurrences that happen within a system or organization is root cause analysis (RC...