Announcement

Collapse
No announcement yet.

How to list folders by size in Linux?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to list folders by size in Linux?

    I always wanted to list folders by size to free up my disk space. Here is one line of command which produces a nice summary of folders sorted by folder size. This command should be pretty handy to use in your linux command line, if you are working as administrator.

    Code:
    du -sc /* | sort -nr
    and the output would look like

    [root@vps ~]# du -sc /* | sort -nr
    19012224 total
    15340868 /home
    1658900 /var
    1096664 /usr
    625316 /root
    178416 /backups
    60764 /lib
    17004 /etc
    13508 /tmp
    9292 /sbin
    5868 /bin
    5588 /db.sql.gz
    8 /mnt
    4 /srv
    4 /selinux
    4 /opt
    4 /media
    4 /lost+found
    4 /dev
    4 /boot
    0 /t
    0 /sys
    0 /proc
    0 /aquota.user
    0 /aquota.group
Working...
X