A hostler can perform a number of different jobs depending on the context, and the term has had slightly different meanings throughout history. In modern usage, hostlers are employed by the horse industry as stablemen and grooms, by the railroad industry to move trains around a yard, and the trucking industry to perform similar tasks with trucks and trailers. The term is commonly spelled "hostler" in the US and "ostler" in the UK, where it was originally used to refer to people who took care of horses at inns and to innkeepers in general.
The word "hostler" can be traced back to Medieval Latin through Anglo-French, and originally referred to monks who were responsible for entertaining guests. This usage was extended to the Anglo-French version of the word, and the original usage in English was to refer to people who cared for the horses of visitors to inns and sometimes to innkeepers. Modern usage in British English usually refers to people who are employed at stables, such as grooms. This usage is also present in American English, though the word has also been extended to somewhat similar jobs in other industries.
When locomotives began to replace horses in moving certain cargo throughout the United States, they were sometimes referred to as iron horses. Locomotives that are not in active use are typically held in rail yards, and the people who are responsible for moving them between tracks and to repair facilities came to be known as hostlers. Though this is a very different occupation from a stableman or groom, dealing with locomotives in a rail yard can be seen as analogous to working with horses within a stable. These employees of the railroad companies are typically authorized to move locomotives within rail yards, but not beyond.
Another modern occupation that is similar to the locomotive hostler has to do with the trucking industry. This industry has a lot in common with the train industry, as it is involved with the shipping of goods from one place to another. Many of the vehicles that are used to transport goods in this industry are known as semi-trailers because they consist of a truck that can tow separate trailers. People who are responsible for moving trucks and trailers around in a staging area perform a very similar task to railroad hostlers, and are sometimes referred to using that term.