Emacs: print key binding for a command or list all key bindings
Solution 1:
C-h f (or M-x describe-function) will show you the bindings for a command.
You are correct, C-h b (or M-x describe-bindings) will show you all bindings. C-h m (M-x describe-mode) is also handy to list bindings by mode.
You might also try C-h k (M-x describe-key) to show what command is bound to a key. For instance, on my machine save-buffers-kill-emacs
isn't bound to anything, but C-h k C-x C-c tells me that C-x C-c is bound to save-buffers-kill-terminal
. It will list all bindings for the command at the same time.
Solution 2:
How about just
M-x where-is <COMMAND>
You get the same information as you'd get with C-h f.
Also bound to C-h w, <f1> w and <help> w.