Du -sh *
Solved
lamou23
Posted messages
218
Status
Member
-
bob031 Posted messages 8228 Status Member -
bob031 Posted messages 8228 Status Member -
1- Is it possible to get the total size of the directories in /var/www without going into their contents and displaying the sizes of subdirectories, files, and everything?
2- If I want to display only the directories with a size > 20K, is there a command that allows me to do that?
Thank you very much.
2- If I want to display only the directories with a size > 20K, is there a command that allows me to do that?
Thank you very much.
3 answers
Hello,
For 1:
For 2, you need to look with the command "find" and its options, particularly "-size +20480k", but that only applies to files with the "-type f" option.
Or you can do it with the "1" command and tools like "awk" through a pipe...
--
$ man woman
There is no manual page for woman.
GNU/Linux: Gnu/Linux is Not Ubuntu!
For 1:
du -sh /var/www/*
For 2, you need to look with the command "find" and its options, particularly "-size +20480k", but that only applies to files with the "-type f" option.
Or you can do it with the "1" command and tools like "awk" through a pipe...
--
$ man woman
There is no manual page for woman.
GNU/Linux: Gnu/Linux is Not Ubuntu!
find /var/www -maxdepth 1 -type d -exec du -s {} \; | awk '$1 >= 20 { print $0 }'