#adjust is the extended command to change the letter that an item in your inventory is stored under. It also allows you to merge and split stacks of identical items.
If you have two or more stacks of identical items (with identical beatitude), you can #adjust one of these stacks to its own slot, and they will all be merged. (This is useful when #dipping identical items in holy water: first merge the stacks, then bless them all at once.)
As of NetHack 3.6.0, the #adjust command can take a count, specifying how many items to move from one slot to another. (For example, to split off one half of a - 10 darts, you can #adjust 5a to b.)
Many players find it useful to #adjust certain useful items to the same slot across games. As an example, consistently having your key in the k slot might save you the annoyance of having to look at your inventory every time you wish to unlock a door. It's also a good idea to readjust your inventory slots so as to prevent typos from killing you: keeping a food ration on y might be lethal if you try to eat it while standing above a cockatrice corpse.
The + key can be used to reorder spells.