Forrest logo
back to the bindkey tool

bindkey:tldr:015a7

bindkey: View keymaps.
$ bindkey -l
try on your machine

The command "bindkey -l" is used to list all the active key bindings in a shell, such as Bash or Zsh.

The "bindkey" command is used to view or modify key bindings, which are shortcuts or functions associated with certain keyboard keys or key combinations. By default, a shell has predefined key bindings, but you can customize them to suit your preferences or to add new functionality.

The "-l" option is used to list the current key bindings. When you execute "bindkey -l", the command will output a list of key bindings in a readable format, typically displaying the key combination or key name on the left and the associated function or command on the right.

For example, the output might look like:

"^A" beginning-of-line "^D" delete-char-or-list "^E" end-of-line "^P" up-history

In this example, "^" represents the Ctrl key. So "^A" means Ctrl+A, which is bound to the "beginning-of-line" function, "^D" is bound to "delete-char-or-list", and so on.

By examining the output of "bindkey -l", you can see which keys are already bound to functions, and you can use this information to avoid conflicts or to create new custom key bindings.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the bindkey tool