BUY buys an object from a shop keeper. When multiple items of the same name are listed, type ‘buy n.item’, where n is the position of the item in a list of that name. So if there are two swords, buy 2.sword will buy the second. If you want to buy multiples of an item, use an * (buy 5*pie will buy 5 pies). These can be combined into (for example) buy 2*2.shield, as long as the * is first.
LIST lists the objects the shop keeper will sell you. List shows you only objects of that name.
SELL sells an object to a shop keeper or pawnmonger.
If you are at a shop with remort items and are not a rebirthed character, you will not be able to buy the item.