 |
 |
Help: Tracking disk usage with df...
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2003
Status:
Offline
|
|
Hi, second problem. Sorry to bother. Right now I'm using:
df -k | grep /dev/disk/*
To display current disk usage. The only problem is I'd rather only get the total in MB and/or % with disk name. I'm now getting even with the grep:
/dev/disk 24415936 6261288 17910492 25% /VolumeName
Any way to get:
Total MB % VolumeName
Thanks.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Feb 2000
Status:
Offline
|
|
you might want to man du and sort
identify the large users that can safely have files removed from the respective directories and or the entire directory structure itself.
If it is a common temporary directory you may also wish to write a script (shell, python, perl, etc.) and possibly add it as a cron job...
HINT: du | sort -nr | head -XXX
(the head as you will invariably have a million small files that you probably don't want to remove anyways, but you may wish to omit that part. Also XXX is some number, which would depend on your typical output, but this is just Q&D.)
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2003
Status:
Offline
|
|
I had been looking at du... Will look again... Thanks.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status:
Offline
|
|
If you really want MB, a simple shell pipe would resolve it
Here's an awk-based solution, but almost any shell processor could handle it:
Code:
df -k | awk '/disk/ {print $4/1024, " " $5, " ", $6}'
|
|
Gods don't kill people - people with Gods kill people.
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2003
Status:
Offline
|
|
That works great... Almost there. Thanks! Any way to get a tab in between the fields?
ie now:
10855.2 14% /Volumes/Scratch
2626.3 3% /Volumes/Swap
115538 1% /Volumes/Multimedia
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jul 2001
Location: NC
Status:
Offline
|
|
Originally posted by jgift:
That works great... Almost there. Thanks! Any way to get a tab in between the fields?
Yes, just put a tab in the quotes that now contain spaces. Of course, if you just hit the tab key, most shells will think you are asking for some sort of completion so you'll have to quote the tab by preceding the keystroke with <Command>-v.
|
|
Gary
A computer scientist is someone who, when told to "Go to Hell", sees the
"go to", rather than the destination, as harmful.
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2003
Status:
Offline
|
|
Got it working with some playing around... Thanks for all the help. happy camper here 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|