Press ? (or, with number_pad on, h) to access the in-game help.
You will see the following menu:
a - Long description of the game and commands. b - List of game commands. c - Concise history of NetHack. d - Info on a character in the game display. e - Info on what a given key does. f - List of game options. g - Longer explanation of game options. h - List of extended commands. i - The NetHack license. j - List of wizard-mode commands.
The last option is only available if the game is in wizard mode.