0

I'm looking to find the disk space on my current working directory... and then only look for directory sizes over 1TB in size... and then take that output, and ls -l all of those specific directories to find which users own those particular directories.

My current assumption would be something like this...

sudo du -sh * | sort -n | grep T

From doing this... I would at least show me the directory sizes over 1TB in size... but then I want to take that output and put it into ls -l, so that I can find the users that are using more than 1TB.

Any help would be so helpful. Thank you!

  • you might want to look into the quota tools. these can be used for per user/per group accounting as well as for setting limits to how much disk space a user or group can use. – cas Jul 26 at 3:26
1

With GNU tools you could do:

du -0ht 1T * | sed -z 's/^.*[[:blank:]]\+//' | xargs -0 ls -ld

You might also want to use . in place of * on the du command to include "hidden" directories, i.e. those whose name begins with .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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