/etc/inputrc
There are a number of configuration files that are common to all
linux system. Inputrc deals with the mapping of the keybord in ceratin
situations. This file is the start-up file used by readline - the input
related library used by bash and most other shells. By changing this file
you can change how certain keys act in different situations. The following
is a simple inputrc along with comments to explain what the various
options do.
The following file can be used as
/etc/inputrc or ~/.inputrc as
appropriate. See below for more details on which to use.
# Make sure we dont output everything on the 1 line
set horizontal-scroll-mode Off
set meta-flag On # Enables 8 bit input
set input-meta On # Enables 8 bit input
set convert-meta Off # Turns off 8th bit stripping
set output-meta On # Keep the 8th bit for display
set bell-style none # none,visable or audible
# All of the following map the escape sequence of the
# value contained inside the 1st argument to the
# readline specific functions
"\eOd": backward-word
"\eOc": forward-word
# for linux console
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line
Please see man 3 readline for more infomation. There is a lot that
can be done with this single rc file.
Note that the readline library checks ~/.inputrc, by default. If
you want to use /etc/inputrc as your global
inputrc (i.e. for all users), you will need to add the line
export INPUTRC=/etc/inputrc to your
.bash_profile, .bashrc or .profile file as appropriate.
If you want to use per-user .inputrc files.
You can create one and drop it into /etc/skel for use
when creating new users.