Kommodor summed it nicely. I would also add that during WW2 the M1 carbine was issued as a substitute or in addition to the 1911 pistol, to be carried by officers, cooks etc. Lighter and smaller than the main battle rifle but easier to become proficient with and more accurate at longer ranges than the pistol.
Tank crews also got the M1 carbine, along with the M3 grease gun, a .45 ACP sub machine gun. Both are effective at shorter ranges for when on watch when in laager, say, but small enough to keep inside the tank.
Cooks carried them also? Must not have been much gripin’ about the chow! ;)