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

Determiniing Space Used in SubDirectories

When space is getting tight, one has to find out where the space is being used. Sometimes it suffices to find where the most accumulation is and cleaning that up. To find that accumulation, use the du command:

 du -h -x  --max-depth=1

The -h turns the result into human readable form, the -x excludes files on a different file system (for when you have a mount somewhere in the structure), and the --max-depth performs a summarizes the results of the recursive search through the structure.

[/OpenSource] permanent link


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

[/OpenSource] permanent link



Blog Content ©2008
Ray Burkholder
All Rights Reserved
ray@oneunified.net
(441) 505 7293
Available for Contract Work
Resume

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

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

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.