![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Filesystems, Disks and Memory Discuss NAS, SAN, RAID, Robotic Libraries, backup devices, RAM, DRAM, SCSI, IDE, EIDE topics here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Disk Space | test10002 | HP-UX | 1 | 07-07-2007 10:34 PM |
| disk space | kingsto88 | Filesystems, Disks and Memory | 3 | 12-06-2006 05:28 AM |
| Disk space? | jbarbuto | SUN Solaris | 4 | 08-18-2004 07:58 AM |
| available disk space on disk device??? | alan | UNIX for Dummies Questions & Answers | 4 | 01-02-2004 03:06 AM |
| Disk space | jxh461 | Filesystems, Disks and Memory | 1 | 06-24-2002 03:23 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
disk space
Hello All-
Am new member to this forum. Have some unix experience. But true believer in it compared to windows. Have a question regarding the disk space. I know a command to check the total disk space utilization using: df -k . but what is the command to check the same disk space by user. How much each of the user is using the disk space. |
|
||||
|
There is no simple command to do what you need.
If people are using ridiculous amounts of disk space, instead of trying to police it yourself, enable disk quotas. If you tell us what you need someone here can help you put together a script. |
|
||||
|
this will not calc how much space is allocated to user, however it finds total size of files owned by user and totals them up.
Code:
awk 'BEGIN{
path="/"
user="root"
total=0
cmd="find "path" -type f -user "user" -printf \"%s\\n\""
while (( cmd |getline line) >0){ total+=line }
close(cmd)
print "total size by user: "user" is: "total" bytes"
}'
|
|
||||
|
disk space
No, I don't want the files sizes, am basically looking for the total disk space usage by a user.
If I give a username, I should be able to find how much he or she is using. I have done this before, but don't remember the command now. |
|
||||
|
That's right, am looking for du command that gives the disk usage by user.
-----Post Update----- How do I run this?? Am only aware of unix commands. Thanks -----Post Update----- How do I run this?? Am only aware of unix commands. Thanks |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| temp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|