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

Is there a way to hide what I'm typing in a shell, so the terminal doesn't echo my keystrokes, while still keeping the output of the command?

For example, if I run ip addr show, the only thing on the screen should be the output from that command -- not the "ip addr show" that I typed.

share|improve this question
Hi. Can you be bit more specific about, content? – Nikhil Mulley Jan 8 '12 at 16:01
Do you mean hiding the standard input like when typing the password on login? Are you using bash? Provide some more information please. – user13742 Jan 8 '12 at 16:08
content means commands, for example if i type an command "ip addr show" it must be not visible in the bash terminal what i am typing . But it can i view the output of it – Mughil Jan 8 '12 at 16:41
That's a weird requirement. What are you trying to achieve? Note that with typical shells, the command will also be entered in the history and saved to disk. – Gilles Jan 8 '12 at 17:04
up vote 19 down vote accepted

If you want to disable echo of the commands you type, try this:

stty -echo

You can re-enable echo using this command:

stty echo

Note that the output of commands will show up in a somewhat different way, see this example session:

$ pwd
$ stty -echo
$ /tmp

This resulted from typing pwd, return, stty -echo, return, pwd, return.

share|improve this answer
Note that this may or may not work depending on your shell, and perhaps on what oddities you put in your prompt. Also the setting applies to everything in that terminal; if you run a full-screen command it's likely to reset to stty +echo. – Gilles Jan 8 '12 at 17:04

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.