A peg is a bolt or pin that holds something in place or marks a location. When you use peg as a verb, it means to identify someone or something: "I pegged you as a word lover, the first time I laid eyes on you."
A coat rack might consist of a line of wooden pegs, and you might also secure a tent by driving metal pegs into the ground to hold it there. When you fasten or pierce something with a peg, you can say you peg it. Informally, if you peg a person, you make a judgment about them: "I'd peg him as a messy housekeeper based on the way his dorm room looks."