Linux: disk usage command – du

du is a standard unix command to calculate disk space from Unix/Linux system.

To get the sum space of the directory,

du

To get sum space with human-readable,

du -sh

To get sub directories space

du -sh *

To get sub directories space with all hidden folder,

du -sk .[!.]* * | sort -n

Linux apt-get

With Debian-based of the Linux system, you will need to use apt-get as the package handle utility to handle your Linux Distro packages.

The Basic of apt-get,
apt-get update
– Resynchronise installed packages with their sources. (Always do this before an upgrade.)

apt-get upgrade
– Install the newest version of all packages installed on the system.

apt-get dist-upgrade
– Upgrade to the latest version of your distribution.

apt-get install package1 package2 package3
– Install programs package1, package2 and package3 along with all their dependencies.

apt-get remove package1 package2 package3
– Remove programs package1, package2 and package3.

apt-get purge package1 package2 package3
– Remove programs package1, package2 and package3 and delete any configuration files that they used.

apt-get check
– Update the package cache and check for any broken dependencies.

apt-get clean
– Clean out retrieved package files.

apt-get autoclean
– Clean out retrieved package files, but only those that are no longer needed.

apt-get autoremove
– Remove any packages that were installed to satisfy dependencies but are no longer required.

For advance usage,

apt-get source package1
– Retrieve source files for package package1.

apt-get build-dep package1
– Get all the dependencies needed to build package package1.

apt-get source package1 -b
– Fetch the source code then compile it.