alternative_folder_size_command

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
alternative_folder_size_command [2025/09/10 12:12] – created walkeradminalternative_folder_size_command [2025/09/23 13:31] (current) – [Introduction] walkeradmin
Line 1: Line 1:
-====== Aquila Live Stat Mux ====== +====== Alternative Folder Size Command ====== 
-<color #db5f0b>Nov 2023</color>+<color #db5f0b>Sep 2025</color>
 \\  \\ 
 \\  \\ 
  
 ---- ----
-Stat Mux +==== Introduction ==== 
 + 
 +There are many ways to work out the size of folders, but this one that I learnt today seems to be perfect for my needs. 
 +\\  
 +\\  
 +It is using the <color #ed1c24>du</color> (disk usage) command again, but with some different switch at the end. 
 +\\  
 +\\  
 +You need to login as <color #ed1c24>root</color> (sudo -s) for this to work as you may end up with permission errors, depending on what folders you are searching. 
 +\\  
 +\\  
 +---- 
 + 
 +Remember, this command works from the folder you are in, so if you want to look at all folders, you need to be at the root folder (cd /). 
 +\\  
 +\\  
 +We are going to use the command <color #ed1c24>du -h --max-depth=1</color> to show folder sizes. 
 +\\  
 +\\  
 +<color #ed1c24>If you are copying and pasting this command, the two dashes can get converted to one dash (--max-depth=1)</color> 
 +\\  
 +<code> 
 +du -h --max-depth=1 
 + 
 +2.2G    ./usr 
 +28M     ./etc 
 +4.0K    ./mnt 
 +4.0K    ./dev 
 +440K    ./.kube 
 +4.0K    ./media 
 +0       ./proc 
 +16K     ./lost+found 
 +14G     ./run 
 +536K    ./tmp 
 +12G     ./opt 
 +70M     ./boot 
 +18M     ./root 
 +0       ./sys 
 +4.0K    ./srv 
 +788K    ./home 
 +26G     ./var 
 + 
 +52G     . 
 +</code> 
 + 
 +Above we can see the size of each folder, and at the bottom the total size of all folders. 
 +\\  
 +\\  
alternative_folder_size_command.1757506326.txt.gz · Last modified: by walkeradmin