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.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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 /tmp $ stty -echo $ /tmp
This resulted from typing pwd, return, stty -echo, return, pwd, return.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0