Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Say there is shared unit that has allocated space to run some analytics, there is not really a limit per user however it has to be often monitored so the user don't leave "trash" that might consume space. What I want to do is to list all the folders within that directory, but also include the owner and the size of the directory.

Right now I use

df /server/shared/alloc

and the output is:

Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/work    1027604480 302184640   71%     6877     1% /server/shared/alloc

But this will only give me the % used instead of what I asked before.

Sorry if this is a noobie question, i'm not really a sys admin just want to be able to monitor so I can email the users that take a lot of space.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

There isn't a single command that provides all the information you want. You can either write a script or use a combination of

  du /server/shared/alloc
  find /server/shared/alloc -type d -ls

The first will give you the total disk usage for (all the files in) each folder and subfolder

The second will give you the ownership of the folders and folders (but not the ownership of the files in those folders)

Note that a directory has a size (related to the number of files in it) that is different from the size of it's contents.

I use the following words interchangeably: folder; subfolder; directory; subdirectory.

share|improve this answer
add comment

If you set up quotas (any value is fine, even setting the whole volume as a limit) then you can use quota to display usage information by the users.

share|improve this answer
    
sorry, like I said I'm a bit of a new.. can you explain ? –  isJustMe Mar 13 '12 at 21:56
    
    
yeah I know what the quota is but how to use it? –  isJustMe Mar 13 '12 at 22:21
    
quota /serv/test/test/ doesnt work –  isJustMe Mar 13 '12 at 22:21
    
Of course not. You didn't set up quotas. –  Ignacio Vazquez-Abrams Mar 13 '12 at 22:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.