  The Clausius inequality (CI) is one of the most versatile forms of the second
law. Although it was originally conceived for macroscopic steam engines, it is
also applicable to quantum single particle machines. Moreover, the CI is the
main connecting thread between classical microscopic thermodynamics and
nanoscopic quantum thermodynamics. In this chapter, we study three different
approaches for obtaining the CI. Each approach shows different aspects of the
CI. The goals of this chapter are: (i) To show the exact assumptions made in
various derivations of the CI. (ii) To elucidate the structure of the second
law and its origin. (iii) To discuss the possibilities each approach offers for
finding additional second-law like inequalities. (iv) To pose challenges
related to the second law in nanoscopic setups. In particular, we introduce and
briefly discuss the notions of exotic heat machines (X machines), and "lazy
demons".
