Beginning nethack, how to use bags

Containers (bags, boxes, chests, etc.) in your inventory are treated differently from those on the ground (which you can access using #loot command). For bags in your inventory, treat them like tools and use them with [a]pply. This will then bring up the menu to add, remove, or just view the items within.