Making a full image of an installed system
I think this is what you are meaning. 

In terminal type in sudo dd if="/dev/disk0" of="/volumes/&lt;volume&gt;/image.img"

Warning

Entering this command wrong could render your computer useless. 

Info

disk0 is the hard drive of your Mac and &lt;volume&gt; is the name of your external drive and image.img is the name of the file you will create

To restore go to internet recovery and swap the if and of arguments. 

This will also backup any partitions you have on your computer. This means if you have boot camp setup it will also backup and restore windows too. Bonus!

Disclaimer
I am not responsible for any damage that you cause to your system when entering in this command. Research the use of the dd command if you are not sure how this works before proceeding.