dpkg can be used for a variety of purposes. It can be used to install and remove packages. But one of the best feature which you can use is to save the current state of your machine.
What is current state of your machine?
You may be wondering what does the current state means. Your ubuntu/debian machine is a collection of many packages. Every time your machine crashes, apart from losing the valuable data, you may also lose the information about various packages you installed in your machine.
dpkg –get-selections gives the list of all package names and their current state like installed, deinstalled etc.
$ dpkg --get-selections acpi-support install acpid install adduser install adium-theme-ubuntu install aisleriot install akonadi-server install ....
You can save the settings into a file using tee.
$ dpkg --get-selections | tee packages_list acpi-support install acpid install adduser install adium-theme-ubuntu install aisleriot install akonadi-server install ....
You can make use of the file packages_list in many ways. Save it in your mail, so that you can use it later or even use it to clone another machine in a similar way.