Action and inaction

Possessing a mind unattached to everything, self-controlled, void of all desires, he attains the accomplishment of perfect actionlessness through Sannyasa (Gita,18-49)

In Shankara’s commentary (the great Indian philosopher and sage) Sannyasa is seen as either right knowledge or renunciation of all action. What is right knowledge in relation to action?

He who sees inaction in action, and action in inaction, he is the wisest of all men; he has a poised mind, and he alone has done all that had to be done. (Gita,4-18)