linux show size of folder contents in ls or some other command
I know these folders each have >80gb of files. Yet, they only show 4.0K in ls -lah? How can I have ls show size including the contents?
[root@aapsan01 aapxen01]# ls -lah
total 48K
drwxrwxrwx 6 root root 4.0K Sep 29 03:45 .
drwxrwxrwx 15 root root 4.0K Sep 27 09:15 ..
drwxr-xr-x 2 root root 4.0K Sep 29 03:45 aapxen01.0
drwxr-xr-x 2 root root 4.0K Sep 28 12:10 aapxen01.1
drwxr-xr-x 2 root root 4.0K Sep 27 09:21 aapxen01.2
drwxr-xr-x 2 root root 4.0K Sep 27 09:21 aapxen01.3
Solution 1:
du --max-depth=1 -h
should show how much space the folders use
Solution 2:
Using the command du
:
du -sh .
Note that this takes some time, because it has to scan the directory contents.
Solution 3:
du -sh
where s
displays a summary of the directory size.h
human readable format
Example:
[root@smsc tmp]# du -sh
219M .