In more recent history, generals have needed to be in a position where they can coordinate the efforts of their troops, usually an area further away from the actual fighting. Thus, there have been fewer examples of commanders getting into the thick of fighting. Also contributing to this was the fact that most officers were from the aristocracy, and were reluctant to risk their priviliged lives in combat. Napoleon was an exception, especially in his early career. He sustained a bayonet wound at Toulon, and he personally led the final assault over the bridge at Lodi in the face of several batteries of Austrian artillery. Later in the Empire, he sustained a minor musket wound to the leg during one of the early battles of the 1813 campaign (Dresden, I think).
Later in the 19th century, commanders almost never led troops in person, as logistics demanded they stay in one area in order to observe the action and issue orders. There were exceptions, though, such as the 1864 battle of Spotsylvania when the Federal assault on the "mule shoe" threatened to collapse the entire Confederate line. General Lee saw the threat and began to lead the reserve forward himself. His men, however, loving him as they did, led the general's horse Traveler back behind the line to safety, then drove the federal assault back out of the mule shoe.