Underpants is term used to describe men's underwear. Underpants are usually the same length as shorts. Unlike trunks, underpants have longer pant legs. Shorty is a kind of underpant with very short legs. Underpants can sometimes be associated with boxers when they are not as wide in the legs.
Underpants can also be long, looking more like pants.
A full tight fitting leg length underpant is also a kind of underwear.