# How to move around in bash - keybindings?



## decuser (Mar 1, 2021)

In the BASH(1) manpage, the keybindings are described. However, these don't seem to be what FreeBSD is using. In particular, it shows:



> forward-word (M-f)
> Move forward to the end of the next word.  Words are composed of
> alphanumeric characters (letters and digits).
> backward-word (M-b)
> ...


Well, M-f works on the command line, but it looks like M-b deletes the previous word, I just wanna move back a word and leave the command line intact like forward-word does. Other keybindings also seem different. I looked for inputrc on the system, but the only instance of this file is - /usr/local/share/doc/bash-completion/inputrc.

Where can I find the actual keybindings that are used by the active shell?


----------



## decuser (Mar 1, 2021)

I am responding to the M-b not working part of the question here, for posterity. I was connecting to the FreeBSD machine via SSH from a MacBook. In testing how it worked on the Mac, I noticed that M-f and M-b, both produced funky characters on the Terminal - ƒ and ∫, respectively. After a bit of research, and remembrance, I figured out that the Terminal settings have a switch for "Use Option as Meta key." Now, M-f and M-b both work in Terminal and in the SSH session with FreeBSD. The question of where to find the active keybindings is still open .


----------



## SirDice (Mar 1, 2021)

decuser said:


> The question of where to find the active keybindings is still open


`bind -p`

On FreeBSD these are pretty much default. You can copy that /usr/local/share/doc/bash-completion/inputrc (gets installed by shells/bash-completion) to ~/.inputrc if you want. Or read `pkg info -D bash-completion`. Some ports install bash completion scripts, those can be found in /usr/local/etc/bash_completion.d/.


----------

