Free up space on your linux machine

Here are some useful commands to free up space on your linux machine. To display the used space of your filesystem:

To display the folders and how much space they take:

Find the 20 largest offenders on your system:

Or use the graphical command line tool ncdu:

If you are using a Debian based system, you can list the installed packages with size:

remove unwanted packages:

and uninstall their unused dependencies:

and finally

clear the packet cache.