How to show largest file and directory size in linux

Print largest file and directory size of the current directory
du -sh * | sort -n -r

Print largest file and directory size of any directory
du -sh * /dirname | sort -n -r
 
Print top 5 maximum file size
du -sh * /dirname | sort -n -r | head -n 5
 
 
Share on Google Plus

About Md. Shahzad Alam

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment