Linux Views 3

Checking directory usage with du

Checking directory usage with du image 1

The du command shows how much space the current directory is using.

du [option]

Option Description 
-a  Prints the usage of every file and subdirectory in the current directory. 
-b  Prints usage in byte size. 
-h  Shows the information in a form that is easier for people to read. 
-k  Prints usage in 1KB units. 
-s  Simply shows only the total usage. 
-c Prints a total.
-x  If there is another file system inside the path being checked, it is skipped.
-L  If there is a symbolic-link file, shows the value of the original.

※If you use it with no options, it prints the size of the current directory in MB.

Command examples

Print the usage of every file and subdirectory in the current directory

Checking directory usage with du image 2

Print usage in byte size

Checking directory usage with du image 3

Print in a form that is easier for people to read

Checking directory usage with du image 4

Print a total

Checking directory usage with du image 5

Print the usage of every file and subdirectory in the current directory

in a form that is easier to read, plus a total

Checking directory usage with du image 6

Reactions

Comments 0

A nickname and a password are required. The same password edits or deletes the comment later. Comments appear after a review.

Comments appear after a review. The password is used again to edit or delete.