How can I identify and purge unecessary files [duplicate]

One nice Gnome application is baobab. It comes with default ubuntu installation.

enter image description here

To get it,

sudo apt-get install baobab

apt-cache show baobab

Description-en: GNOME disk usage analyzer
 Disk Usage Analyzer is a graphical, menu-driven application to analyse
 disk usage in a GNOME environment. It can easily scan either the whole
 filesystem tree, or a specific user-requested directory branch (local or
 remote).
 .
 It also auto-detects in real-time any changes made to your home
 directory as far as any mounted/unmounted device. Disk Usage Analyzer
 also provides a full graphical treemap window for each selected folder.

ncdu

If you use the command line, you could use ncdu. It uses a command-line GUI (ncurses).

Installation

sudo apt-get install ncdu

Description

From its webpage:

[...] ncdu: A disk usage analyzer with an ncurses interface, aimed to be run on a remote server where you don't have an entire gaphical setup, but have to do with a simple SSH connection. ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed.

Screenshot

Screenshot from the ncdu webpage

Example

Check out the disk usage of your home directory:

ncdu ~

You can enter subdirectories and delete files / whole folders from within the tool.


Another very useful app for this is:

JDiskReport

Is very similar to windows SpaceSniffer and has a very useful and intuitive IU.

You need Java to use it but it can run in every OS with Java

The user interface:

JDiskReport example in linux

Hope it helps !


Use the ducks:

du -cks *|sort -rn|head -n11

This will list the top ten subdirectories and files in the current path and the space they are using, and a total.

If you change the -cks to -cms it reports in MB's instead of KB's, which is probably more useful these days.

You can add x to the options on du to prevent it going into other file systems, if needbe.

(Credit: Linux Server Hacks, O'Reilly)