Punishment aboard ship
The most notorious was flogging at the grating with a cat of nine tails or "the cat". However, there were a number of other punishments available, such as being confined in bilboes or irons, stopping of the offender's grog ration or ordering the offender to perform an unpopular task such as cleaning the heads.
Legally a captain could not order more than twelve stokes of the cat. However, by splitting the charges into several offences, more could be ordered. Younger crew members might be punished by being beaten with a cane while tied over a cannon, "kissing the gunner's daughter".
Keelhauling was a very severe punishment where an offender was dragged under the hull. This was usually done from one side of the ship to the other and could be repeated one or more times. It was not usually fatal but the barnacles usually found on the hull could lacerate the skin and cause severe injuries. In the Royal Navy this was not a legal punishment, though other navies did use it and it was more common on pirate ships. Sometimes the keelhauling was carried out lengthways along the hull, in this case the offender usually drowned.
Patrick O'Brian often describes midshipmen and other young crew members being "mast-headed", i.e. sent to the top of the mast to stay there until the officer decided to allow them down. This was usually a minor punishment, equivalent to being sent to stand in a corner, but could be unpleasant or hazardous in rough or stormy weather.