Wednesday, March 16, 2016

how to find out the disk usage on linux system

1- we can use df to show the available space and used space,

some parameters available in df command
  -a, --all             include dummy file systems
  -B, --block-size=SIZE  scale sizes by SIZE before printing them.  E.g.,
                           '-BM' prints sizes in units of 1,048,576 bytes.
                           See SIZE format below.
  -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)
  -H, --si              likewise, but use powers of 1000 not 1024
  -i, --inodes          list inode information instead of block usage
  -k                    like --block-size=1K
  -l, --local           limit listing to local file systems
      --no-sync         do not invoke sync before getting usage info (default)
      --output[=FIELD_LIST]  use the output format defined by FIELD_LIST,
                               or print all fields if FIELD_LIST is omitted.
  -P, --portability     use the POSIX output format
      --sync            invoke sync before getting usage info
      --total           elide all entries insignificant to available space,
                          and produce a grand total
  -t, --type=TYPE       limit listing to file systems of type TYPE
  -T, --print-type      print file system type
  -x, --exclude-type=TYPE   limit listing to file systems not of type TYPE

**but mostly we use -h (human-readable switch)
~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7.7G  4.0K  7.7G   1% /dev
tmpfs           1.6G  996K  1.6G   1% /run
/dev/sda2       443G  409G   12G  98% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            7.8G   26M  7.7G   1% /run/shm
none            100M   12K  100M   1% /run/user
/dev/sda1       511M  3.4M  508M   1% /boot/efi
/dev/sdb1       587G   90G  492G  16% /media/600gb
/dev/sdc1       1.8T  1.6T  107G  94% /media/2tb

2- there are also graphical tool call filelight, that it can show where your the diskspace is being used.
use sudo apt-get install filelight and run filelight in terminal or launcher, it will bring you to the filelight windows, then you will findout which directory is consume the most space

No comments:

Post a Comment