-2

Given a directory d and a list of users, I want to find disk space used by each user in directory d.I cannot install any utility as it's a production environment so need a result using standard LINUX command(s)

Ansh
  • 2,366
  • 3
  • 31
  • 51

3 Answers3

3

you mean just a du -sh of /home/ ?

du -sh /home/*
1.2G    /home/user001
...
Nico
  • 559
  • 4
  • 22
1

The following shell script will get the disk usage, in human readable form (-h), sort the results and deliver the top 10 values:

sudo du -Sh | sort -rh | head -10
Bob Dalgleish
  • 8,167
  • 4
  • 32
  • 42
0

You can try -
du -shc /home/*

Where,
s :- display total size of a file or total size of all files in a directory.
h :- human readable format.
c :- display a total size usage at the end of result.

Khilesh Chauhan
  • 739
  • 1
  • 10
  • 36