On some Unix systems, I can type Ctrl-A or Ctrl-E to move to the beginning or end of the line. On some Unix systems I can not and it just prints ^A or ^E, etc. What controls whether this keystoke works as I expect (move around the command line), or prints the ^A, ^E, etc. character?
It all depends on specific shell implementation (you might have different default shell on different systems or even for different users within a single system, e.g. bash, ksh, tcsh, etc).
Also it depends on shell itself.
E.g. bash supports two modes: emacs and vi. Each mode has its own shortcuts (emacs or vi like). To change it you have to execute
set -o emacs (normally it's a default one) or
set -o vi
You can find more information in your specific shell documentation.
set -o emacs
will enable the Ctrl-A, Ctrl-E, Ctrl-B, etc emacs key bindings in most shells you're likely to use.
The shell may not have any line editing capabilities, or may be in the
vi editing mode (the only one specified by the standard).
When not in
emacs editing mode, the Ctrl-A and Ctrl-E have no special significance. If the
echoctl stty/termios setting are on, all control keys which are not handled specially will be displayed in the
^X, etc, "caret" notation.
Many shells (like
zsh) will determine the default editing mode (vi or emacs) based on the values of
EDITOR environment variables (in this order of precedence, and also handling variants like
This was broken (very annoyingly!) in
mksh, but it's also still the case in other
Other shells like
tcsh default to the
emacs editing mode, but that may also be overridden from the configuration file of the line editing library.
readline library used by
bash and many other programs, the configuration files is
~/.inputrc (or a file specified in the
INPUTRC environment variable) with a fallback to
/etc/inputrc and the settings are:
set editing-mode vi set editing-mode emacs
libedit library used by many BSD programs, the configuration file is usually
~/.editrc and the settings are:
bind -v # for vi bind -e # for emacs
 not to be confused with the
libeditline readline "work-alike" which only provides an emacs editing-mode.