Skip to content

How to Order by File Size using the du command in Linux

If you use the du command to list all the file sizes on Linux:

du # or du -h # Human readable
Code language: Bash (bash)

Then you would have noticed that they are not ordered by file size.

Instead you can pass that result to the sort command as follows:

du -h | sort -h
Code language: Bash (bash)

See also  How to set ZSH as your default Shell
Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x