Disk space commands on linux


July 1st, 2008

Linux console is the best place for a system admin, some useful commands to check disk space on a linux system are:

Show files by size, biggest last:

ls -lSr 

Show top disk users in current dir.

du -s * | sort -k1,1rn | head

Show free space on mounted filesystems

df -h

Show free inodes on mounted filesystems

df -i 

Show disks partitions sizes and types

fdisk -l

List all packages by installed size (Bytes) on rpm distros

rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1n

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


1 Comment »

  1. Thanks!!! , that helped me a lot, I was searching for a utility showing the free disk space on partitions. Like fdisk does showing geometry, would be very usefully if showed another column with freedisk space.
    Anyway, i spent looking for an option or switch for mount/fdisk/sfdisk/dir to show free disk space, but there is another one specially designed for this.
    :)

    Comment by Slava — October 3, 2008 @ 8:01 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment