Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Probably a newby's question - I saw the command stty erase ^H in one of our log-in script and wanted to know what it does. Does it work on TCSH? or is it only applicable to KSH?

share|improve this question
up vote 4 down vote accepted

From: man stty:

       stty - change and print terminal line settings
-- snip

   erase CHAR
          CHAR will erase the last character typed

This means that ^H (Ctrl-H) will be configured as control sequence to eliminate the last typed character.

share|improve this answer
Thanks, are there other alternatives than ^H? – RonK May 2 '11 at 10:22
Well, that's what the command is used for: To configure it to your liking. If you use stty erase e, the e key will delete characters, but you couldn't type an e anymore. Also, ^H is pretty much the standard expected by admins, so I wouldn't change it if not necessary. – Sven May 2 '11 at 10:36
Thanks - so it binds the ^H chacarcter (ASCII code: 8) to the erase character command (i.e. what you expect pushing the backspace key to perform. Any reason why this is something that needs to be explicitly done? Is it not the default on any Unix/Linux installation? – RonK May 2 '11 at 11:08
All this tty stuff comes from way back when people used serial lines to connect their (dumb) terminals to hosts and was enhanced over time to solve multiple issues when totally different and incompatible systems started to communicate which each other (BTW, tty stands for teletype...). Also, many things in a Unix/Linux system have no real default setting, but have to be configured at startup (often with customary "defaults"). – Sven May 2 '11 at 11:29
Thanks, your explanation was very helpful! – RonK May 2 '11 at 11:45

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.