Using BASH, how can I use du -ch to output only the total collective size?

I try to run du -ch in several directories, but I only separately show only the total size of all files (I do not want each separate file, and then the end at the end, that is, -c does).

+5
source share
2 answers

To resolve this issue, run the following command as parameter transfer directories.

 du -hs 
+1
source

Some ideas:

 $ du -sh . $ du -chs * $ du -chs * | tail -1 
+1
source

Source: https://habr.com/ru/post/1242119/


All Articles