Windows
Linux
Terminal & Shell Scripting
Terminal
Windows pause equivalent in Linux
Halts a script and waits for the user to press a key before continuing. Used frequently in batch files.
Windows
→
pause
Linux equivalents
read -p
read -p
read -p
Overview
What this command does
Halts a script and waits for the user to press a key before continuing. Used frequently in batch files.
Migration tip: Linux has no built-in
pause command. Use read in scripts to wait for input. For a single keypress without needing Enter, use read -n 1.Practical tasks
Common use cases
Pause a script and wait for keypress
Halts a script and waits for the user to press a key before continuing. Used frequently in batch files.
read -p 'Press Enter...'
Wait for Enter key
read -n 1 -s
Wait for any single key (silent)
read -t 10
Auto-continue after 10 seconds
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
read -p 'Press Enter to continue...'
read -n 1 -s -p 'Press any key...'
echo
read -t 10 -p 'Auto-continuing in 10s... ' || true
Walkthrough
Examples with explanations
# Windows: pause
read -p 'Press Enter to continue...'
# Wait for any key (no Enter needed):
read -n 1 -s -p 'Press any key...'
echo # newline after
# Auto-continue after timeout:
read -t 10 -p 'Auto-continuing in 10s... ' || true
Reference
Common options and variations
| Command or option | Use |
|---|---|
read -p 'Press Enter...' | Wait for Enter key |
read -n 1 -s | Wait for any single key (silent) |
read -t 10 | Auto-continue after 10 seconds |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | read -p |
Same command on this distribution. |
| Fedora | same command | read -p |
Same command on this distribution. |
| Arch | same command | read -p |
Same command on this distribution. |
Keep learning