Tame Your Terminal Echo with `stty`

Quick Tip

Tame Your Terminal Echo with `stty`

Challenge: Sometimes, when typing commands, especially with sensitive information or within scripts, you might want to control whether characters are displayed on the screen as you type. This is particularly useful in automated scripts or when sharing a terminal with others.

The Solution: The `stty` command provides a powerful way to control terminal attributes, including echoing characters.

stty -echo

Why it works: The `stty -echo` command disables character echoing for the current terminal session. This means that what you type will not be displayed on the screen, making it useful for masking passwords or other sensitive input in interactive scripts.

Pro-Tip: To re-enable echoing, use stty echo. You can also use stty sane to reset terminal settings to their defaults.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted