-1

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.

1

1 Answer 1

1

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").

3
  • @Arcticooling See my edit Nov 25, 2017 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. Nov 25, 2017 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. Nov 25, 2017 at 22:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .