Read secret input without echoing characters.

Section: Reading Input

Read secret silently

bash
bash
read -r -s -p 'Password: ' password; echo
Explanation

Common for credentials in interactive scripts.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Reading Input
Prompt user for input
Read one line from stdin with a prompt.
OpenIn sheetbashsame section
Read delimited fields
Parse delimited input into multiple variables.
OpenIn sheetbashsame section
Load file into array
Read all lines of a file into an array.
OpenIn sheetbashsame section
Create indexed array
Create an indexed array.
Create associative array
Declare an associative array.
Lowercase string
Convert a string to lowercase.