Taming Terminal Echo: Control Input Display with `stty`
Quick Tip
Taming Terminal Echo: Control Input Display with `stty`
Challenge: Sometimes, especially when working with sensitive input or in scripting, you might want to control whether characters typed into the terminal are displayed on the screen. This is known as “terminal echo.”
The Solution: The `stty` command allows you to manipulate terminal line discipline settings, including echo.
# To disable terminal echo: stty -echo # To re-enable terminal echo: stty echo
Why it works: `stty -echo` tells the terminal to stop sending characters typed by the user back to the display. `stty echo` reverses this behavior, making characters visible again.
Pro-Tip: You can temporarily disable echo within a script for password input using `stty -echo` before reading the input and then immediately re-enable it with `stty echo` afterwards.
Linux Tips & Tricks | © ngelinux.com | 6/10/2026
