Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .