"Capt. Ed. Armstrong (Col'd) & crew of batteau Tam O'Shanter on beach of New River, West Virginia." 1872 (Library of Congress)
According to Wikipedia:
Tam o' Shanter (often abbreviated TOS or Tam) is a 19th-century nickname for the traditional Scottish bonnet worn by men. It is named after "Tam o' Shanter", the eponymous hero of the poem by Robert Burns. . . . A khaki Balmoral bonnet was introduced in 1915 for wear in the trenches by Scottish infantry serving on the Western Front. This came to be known as the bonnet, Tam o' Shanter later abbreviated to ToS. Today, the Royal Regiment of Scotland and some regiments of the Canadian Forces continue to wear the ToS as undress and working headgear.