How to set keys (backspace, interrupt, suspend, kill)?

Using stty one can set some of keys like backsapce, interrupt, suspend and kill.
$ stty -a # shows the current terminal settings
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;

$ stty erase \^? # set backspace key for backspace
$ stty intr \^C # set Control-C for interrupt
$ stty susp \^Z # set Control-Z for suspend
$ stty kill \^U # set Control-U for kill

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.