The `stty` Secret: Tame Your Terminal Echo

Quick Tip

The `stty` Secret: Tame Your Terminal Echo

Challenge: Sometimes, when debugging or interacting with sensitive input, you might want to prevent characters from being displayed on the terminal as they are typed, or conversely, ensure they are displayed. This is often referred to as “terminal echo”.

The Solution: The `stty` command is your friend here. You can use it to toggle terminal echo on and off.

# To disable terminal echo (useful for passwords or sensitive input) stty -echo # To re-enable terminal echo stty echo

Why it works: `stty` (set tty) is a utility that changes and prints terminal line settings. The `-echo` option disables the local echoing of input characters, while `echo` re-enables it.

Pro-Tip: You can also temporarily disable echo for a specific command like reading a password using `read -s`.

Linux Tips & Tricks | © ngelinux.com | 6/10/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted