One Unified Global Perspective
Communications with a Global Perspective
Home
Intro
Contact Us
Voice over IP
PBX Solutions
Services
Support
Glossary
Open Source
Blog
Forum

WebMail





2007 May 08 - Tue

Removing lots of files

If I don't have a clean up program running, sometimes autocollected files tend to accumulated. For example, netflow processing on 5 minute intervals can accumulate a large number of files. An 'rm' with a partical wild card seems to complain.

I've resorted to a chaining some command line utilities to come up with a quick script to remove files:

ls -1 | grep ft-v05.2007-0[123] | sed 's/^/rm /' > t.sh

This generates a one column directory listing and puts it through grep. Grep looks for a few specific months of files and passes the list onto sed. Sed preappends the removal command onto each file name. The whole shooting match is thrown into a shell script.

Either set execute privileges on the script:

chmod 500 t.sh

Or run with with the shell command:

bash t.sh



Blog Content ©2012
Ray Burkholder
All Rights Reserved
ray@oneunified.net
(441) 500-7292
Available for Contract Work
Resume

RSS: Click to see the XML version of this web page.

twitter
View Ray 
Burkholder's profile on LinkedIn
technorati
Add to Technorati Favorites



May
Su Mo Tu We Th Fr Sa
   
8
   


Main Links:
Monitoring Server
SSH Tools
QuantDeveloper Code

Special Links:
Frink

Blog Links:
Sergey Solyanik
Marc Andreessen
HotGigs
Micro Persuasion
... Reasonable ...
Chris Donnan
BeyondVC
lifehacker
Trader Mike
Ticker Sense
HeadRush
TraderFeed
Stock Bandit
The Daily WTF
Guy Kawaski
J. Brant Arseneau
Steve Pavlina
Matt Cutts
Kevin Scaldeferri
Joel On Software
Quant Recruiter
Blosxom User Group
Wesner Moise
Julian Dunn
Steve Yegge
Max Dama

2007
Months
May




Mason HQ

Disclaimer: This site may include market analysis. All ideas, opinions, and/or forecasts, expressed or implied herein, are for informational purposes only and should not be construed as a recommendation to invest, trade, and/or speculate in the markets. Any investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied herein, are committed at your own risk, financial or otherwise.