Finding big files in your home

which folders are big in your home

du --exclude='.snapshot' --si -d 1 ~ | sort -h

Here is just what you should obtain :

738k    /home/me/.ssh
914k    /home/me/.gconf
1.7M    /home/me/.kde
2.3M    /home/me/.fontconfig
2.4M    /home/me/.adobe
5.6M    /home/me/.emacs.d
7.3M    /home/me/.cache
14M     /home/me/Pictures
34M     /home/me/Docs
144M	/home/me/.mozilla
147M	/home/me/.thunderbird
176M	/home/me/config.break
2G      /home/me/Downloads
2.5G	/home/me

You can see in this exemple that the Downloads directory is very big and need a littel cleanup.

check a single folder size with

$ du --si -s Downloads | sort -h
2G    Downloads

which files are big in one folder

$ cd ~/Downloads
$ du --si -s * | sort -h
...
21M    kernelAndFirmware_wolfson_rt.tar.bz2
22M    Jellyfish-3-Mbps.mkv
27M    owncloud-7.0.2.tar.bz2

be careful of .hidden files .[!.]*

$ cd ~/Downloads
$ du --si -s * .[!.]* | sort -h
...
21M    kernelAndFirmware_wolfson_rt.tar.bz2
22M    Jellyfish-3-Mbps.mkv
27M    owncloud-7.0.2.tar.bz2
1.1G   .xubuntu-14.10-desktop-amd64.iso

find : an other way to do

This command will sort you by size every file over than 10M that are in your home.

$ find ~ -name .snapshot -prune -o -size +10M -exec du --si {} \; | sort -h
...
23M    /home/me/Downloads/Jellyfish-3-Mbps.mkv
25M    /home/me/.mozilla/firefox/h9q738j2.default/webappsstore.sqlite
28M    /home/me/Downloads/owncloud-7.0.2.tar.bz2
33M    /home/me/.thunderbird/9mefhzhq.default/calendar-data/cache.sqlite-wal
65M    /home/me/PLANS.zip
1.1G   /home/me/Downloads/.xubuntu-14.10-desktop-amd64.iso

ncdu : one more other way ‘the fastest’

$ cd ~
$ ncdu --exclude=.snapshot

It will scan all your home and display a size ordered table.

--- /home/gueko ---
    1.8GiB [##########] /Downloads
  825.6MiB [####      ] /.local
  167.0MiB [          ] /config.break
  158.9MiB [          ] /.thunderbird
  151.2MiB [          ] /.mozilla
  107.2MiB [          ] /.googleearth
   81.2MiB [          ] /.config
   69.7MiB [          ] /.thumbnails
   61.4MiB [          ]  PLANS.zip
   50.1MiB [          ] /.java
   ...

option explanation :

du

–si : like -h, but use powers of 1000 not 1024
-h, –human-readable : print sizes in human readable format (e.g., 1K 234M 2G)
–exclude=‘.snapshot’ : we don’t want to check the space used by the snapshots that are not in my quota
* .[!.] : here we want all files with *, then we want all .dot files with .*, but we don’t want the . and .. ones ! with [!.]

sort

-h, –human-numeric-sort : compare human readable numbers (e.g., 2K 1G)

find

-name .snapshot -prune : dont look in .snapshot dir
-size +10M : look at every file over than 10M
-exec du –si : for every find files display them with du