Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Systems > Linux / BSD / OS X

Reply
 
LinkBack Thread Tools Display Modes
Old 04-11-2003, 11:45 AM   #1 (permalink)
Antagony
Registered User
 
Antagony's Avatar
 
Join Date: Mar 2003
Posts: 31
Antagony is on a distinguished road
Send a message via ICQ to Antagony
Checking disk quota on multi-user system

At my university we get a linux account with 75 megs of disk space. I was looking through the "df" manpage and I realize I need to use some other command to figure out how much of my quota I have left to use.

Anyone know how I could do this? Perhaps I need to write a script?

Or as an alternative, how could I manipulate the "ls" command to show me how much disk space I've used under my home directory?

It's some flavor of Redhat 7 if that helps any. Thanks for reading my dumb post.
Antagony is offline   Reply With Quote
Old 04-11-2003, 12:54 PM   #2 (permalink)
EscapeCharacter
GNU/Punk
 
EscapeCharacter's Avatar
 
Join Date: Jul 2002
Location: stuffs
Posts: 66
EscapeCharacter is on a distinguished road
Send a message via AIM to EscapeCharacter
if all your files are in one directory you could just do a simple 'du -sh [directory_name]' for example if the only directory you files in is ~/ then du -sh ~/

s is for summary(otherwise each file name gets printed)
and h for human readable ie meg gig
__________________
cd /usr/ports/misc/life && make install
EscapeCharacter is offline   Reply With Quote
Old 04-11-2003, 02:04 PM   #3 (permalink)
EscapeCharacter
GNU/Punk
 
EscapeCharacter's Avatar
 
Join Date: Jul 2002
Location: stuffs
Posts: 66
EscapeCharacter is on a distinguished road
Send a message via AIM to EscapeCharacter
heh i got bored so heres one for you if you have files scattered all over the system, use with caution or your sys admin will hate you (youll understand when you look at the code)

Code:
#!/bin/sh

FILES=`find / -user $1 2>/dev/null`
SIZE=0
for i in ${FILES}
do
    TMP=`du ${i}|cut -f 1 2>/dev/null`
    if [ ! $? -eq 1 ]; then
        let "SIZE=${SIZE}+${TMP}" 2>/dev/null
    fi
done
PERCENT=`bc << EOF
(${SIZE} * 100) / 76800
EOF`
echo "Quota size is ${SIZE}k using ${PERCENT}%"
not perfect but whatever
__________________
cd /usr/ports/misc/life && make install
EscapeCharacter is offline   Reply With Quote
Old 04-13-2003, 11:59 AM   #4 (permalink)
Antagony
Registered User
 
Antagony's Avatar
 
Join Date: Mar 2003
Posts: 31
Antagony is on a distinguished road
Send a message via ICQ to Antagony
Awesome, thank you sir!
Antagony is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
checking system configuration with JAVA callmefiero Java 3 08-26-2004 02:38 AM


All times are GMT -8. The time now is 10:41 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting