Sponsored Content
Top Forums Programming Check the Disk usage Programmatically Post 83818 by SriSri on Tuesday 20th of September 2005 01:31:41 AM
Old 09-20-2005
Check the Disk usage Programmatically

Hi all,

Do we have anyway to get the freediskspace for within a C program?

I need functionality similar to 'df -h' -> which gives the % of utilization...

Otherwise, if we go and use 'system ("df -h /home/myhome/")', do we have any way of capturing the output into a string and parse the string to get the % of utilization?


-Sri
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

disk usage

how to i find out the disk usage on a server. say in windows examples its like C:/ D:/ and checking out the disk space. how can i find in Unix. can i just use df -k or should i go to each volume group and find that way. plz respond (2 Replies)
Discussion started by: karthikosu
2 Replies

2. Shell Programming and Scripting

disk usage

Hi ,.. I am working on a script like.... it has to monitor the disk usage (df -H) and if usage is above 95% then it has to return the particular mount point details... i am in confusion to use awk or sed..... regards rrs (1 Reply)
Discussion started by: rrs
1 Replies

3. Shell Programming and Scripting

disk usage

fdisk -l shows me the total disk size. How can I see, how much disk space is free or available? (5 Replies)
Discussion started by: tjay83
5 Replies

4. Shell Programming and Scripting

disk usage

Hi If the disk space is running low in the home directories, and I cannot add more disk space at the moment. How can I determine who is using the most disk space? (4 Replies)
Discussion started by: tjay83
4 Replies

5. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

6. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

7. UNIX for Advanced & Expert Users

How to check total disk usage ?

Hi.. What is the command to check total disk usage for specific directory in MG/GB/Byte ? As example i want to check disk usage for directory pproc ? Please help me.. Thank you, Baharin (3 Replies)
Discussion started by: bh_hensem
3 Replies

8. UNIX for Dummies Questions & Answers

Disk Usage

Hi, I have always felt problems using commands to check disk usage, or I should say I might not be using the commands properly. dfspace and free are 2 most frequent command that I use, but the data that it echoes is not comprehandable atleast to me.:wall::wall::wall::wall::wall: I want... (4 Replies)
Discussion started by: TH3M0Nk
4 Replies

9. HP-UX

Disk Usage

Hi Experts, glance is showing disk util 100% on of production domain and while collecting sar data using sar -d 5 5, avserv for some of the disks are more than 10 miliseconds. Need your advise on steps that needs to be taken to reduce the disk utilitzation. device %busy avque r+w/s ... (2 Replies)
Discussion started by: sai_2507
2 Replies

10. UNIX for Beginners Questions & Answers

Disk usage monitoring and record the disk used in last 24 hour

HI I am Trying to edit the below code to send email every day with difference of disk utilized in for last 24 hours but instead getting same usage everyday. can you please help me to point out where my calculation is going wrong. Thank you. ================= #!/bin/bash TODAY="at $(date... (0 Replies)
Discussion started by: Mi4304
0 Replies
quota(1)						      General Commands Manual							  quota(1)

NAME
quota - display disk usage and limits SYNOPSIS
user ... group ... DESCRIPTION
The command displays the disk usage and limits for one or more user(s) or group(s). By default only the user quotas are printed. Without the option, it displays information only when the usage exceeds the limits. user or group is a name or a numeric ID of a user or a group. The default value of user is the login user name. Refer to usergroupname(5) to understand the functionality changes with the Numeric User Group Name feature. Only users with appropriate privileges can view the limits of other users. Options The command recognizes the following option: When specified without the group argument, displays quotas of the groups for which you are a member. The optional group argument(s) restricts the display to the specified group(s). Displays user quotas (the default). When specified without the user argument(s), displays your quotas. The optional user argument(s) restricts the dis- play to the specified user(s). Display the statistics whether they exceed limits or not. Note that no usage statistics exist if no quota is set. EXTERNAL INFLUENCES
Environment Variables determines the language in which messages are displayed. If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari- able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single and multi-byte character code sets are supported. AUTHOR
Disk Quotas were developed by the University of California, Berkeley, Sun Microsystems, Inc., and HP. FILES
User and group quota statistics static storage for a file system respectively, where directory is the root of the file system as specified to the command (see mount(1M)). List of currently mounted file systems. SEE ALSO
quota(5), usergroupname(5). quota(1)
All times are GMT -4. The time now is 09:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy