Difference between revisions of "Linux du"

From John Freier
Jump to: navigation, search
(Created page with "du or Disk Usage is a tool used to find the amount of space used up. This is useful when trying to clean up space or just see what is taking up a lot. The below command will...")
 
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
 
The below command will show all the folder that have space greater then 500000 bytes and ordered.
 
The below command will show all the folder that have space greater then 500000 bytes and ordered.
 
   du -k ./* | awk '$1 > 500000' | sort -nr
 
   du -k ./* | awk '$1 > 500000' | sort -nr
 +
 +
The below command shows the current folder and how much
 +
  du -h --max-depth=1 | sort -hr
 +
 +
The below command will show the amount of space for each directory and file.
 +
  du -sh *

Latest revision as of 11:54, 19 September 2022

du or Disk Usage is a tool used to find the amount of space used up. This is useful when trying to clean up space or just see what is taking up a lot.

The below command will show all the folders and how much space they use up.

 du -k ./*

The below command will show all the folders that have space greater than 500000 bytes.

 du -k ./* | awk '$1 > 500000'

The below command will show all the folder that have space greater then 500000 bytes and ordered.

 du -k ./* | awk '$1 > 500000' | sort -nr

The below command shows the current folder and how much

 du -h --max-depth=1 | sort -hr

The below command will show the amount of space for each directory and file.

 du -sh *