Tried to assign control n to bind any readline function in bash but can't, e.g:

bind '"\C-n" : previous-history'

but still work as bind -x '"\C-n" : "echo foo"'

Why and how to solve it?

  • Try bind '"\C-n": previous-history', without no space before :. This is not an answer because I cannot answer "why?". Sep 15, 2020 at 6:20
  • Shouldn't Ctrl-N be next-history?
    – user313992
    Sep 15, 2020 at 7:17

1 Answer 1


As Kamil Maciorowski said Try bind '"\C-n": previous-history'

without any space before :

While it's fine to have space after :

You must log in to answer this question.