What is the difference between shell builtins (like cd or echo) and shell keyboard shortcuts (like ctrl+u or ctrl+l)?

Both seems to me "builtins", what is the major difference by means of system architecture?

I personally use Bash but I believe this question is relevant for many other sh shells.


Most builtins change the status / behaviour of the shell ("permanently"). echo and printf are exceptions.

^U and ^L are key bindings. They just handle the input line editing. You could do the same without these functions. They just save time. After executing a command it does not make a difference whether a key binding function was used earlier.

The maybe most obvious difference is that key bindings are not a command which you can run from the command line. You need a builtin (bind) to configure them (shell "state change").

  • @Arcticooling See my edit – Hauke Laging Nov 25 '17 at 1:46
  • Hmm thanks. I thumbed up. Just one more last thing - The first passage was a bit unclear to me (change the behavior of the shell ("permanently"). Given all is changeable, generally, so I didn't quite understand what you meant right there. – Arcticooling Nov 25 '17 at 21:40
  • 1
    @Arcticooling E.g. shopt -s extglob nullglob globstar failglob changes the way the shell does globbing. This change is in effect until it is changed again with shopt. – Hauke Laging Nov 25 '17 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.