Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Yesterday I was fed up with being forced to type Caps+Backspace to erase character in Putty, because a Backspace was printing a ~.
I found some info on internet saying you should type stty erase ~, or at least that how I understand it.
Since then when I type on / it send a to the terminal and I'm not even capable to copy/paste in my putty.
Does anyone has a good idea to save me ?

/ is still working in binary like vi or more but not in bash (where I typed the command).

Additional info:

bash-3.2# stty -a
speed 38400 baud; 55 rows; 210 columns
eucw 1:1:0:0, scrw 1:1:0:0:
intr = ^C; quit = ^\; erase = /; kill = ^U; eof = ^D; eol = <undef>
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; dsusp = ^Y; reprint = ^R
discard = ^O; werase = ^W; lnext = ^V
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -parext
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff -imaxbel
isig icanon -xcase echo -echoe -echok -echonl -noflsh
-tostop -echoctl -echoprt -echoke -flusho -pending -iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3

Edit 2:
Also stty -g provide a string usable by other stty so if you have a working command elsewhere you can export the result of one to import it to the buggy one.

share|improve this question
Maybe ~ got expanded as /path/to/your/home/dir and the erase character got set to the first character of that. – Mark Plotnick Feb 5 '14 at 14:50
Type stty erase '~' (with single quotes). – Mark Plotnick Feb 5 '14 at 14:58
<3 I LOVE YOU <3 you should post it as an answer – Kiwy Feb 5 '14 at 15:00
Now that it is fixed, you can also consider configuring what key putty sends when you hit the backspace key as an alternative to adapting the shell to putty. – casey Feb 5 '14 at 16:32
up vote 2 down vote accepted

An unquoted ~ expands to /path/to/your/home/dir in most shells.

The stty man page doesn't say what it does when the argument to erase is something other than a single character or undef or ^ followed by a character, but it looks like your stty uses the first character of the argument string.

Type stty erase '~' (with the single quotes). It's good practice to always quote the argument, because some shells treat ^ as the pipe symbol.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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