CTRL+_ is used to do UNDO in console; is it possible to map that another key combination like CMD + Z?
its possible to map undo to another combination?
bash;zsh;keyboard shortcuts
Yes, but that depends on your shell. In bash, you have to use bind:$ bind '\C-t':undoThis will bind Ctrl-t to undo. Note that you cannot bind Ctrl-z in most terminal emulators. Refer to help bind for more information.If you want the current list of all key bindings, use bind -P | grep -v not found.In zsh, you have to use bindkey:$ bindkey '\C-t' undoKeep in mind that you probably want to remove the old bindings for whatever key you'll choose. For example, \C-t is bound to transpose-chars.In case you're wondering where all those combinations come from: Emacs. See man 1 bash, section Readline Command Names for more information.