Windows
Linux
Terminal & Shell Scripting
Terminal
Windows break equivalent in Linux
Stops a currently running command or script. Ctrl+C sends SIGINT to the foreground process.
Windows
→
break
Linux equivalents
Ctrl+C
Ctrl+C
Ctrl+C
Overview
What this command does
Stops a currently running command or script. Ctrl+C sends SIGINT to the foreground process.
Migration tip: Press Ctrl+C to interrupt any running command. Ctrl+Z suspends it (pauses it and puts it in the background). Ctrl+D sends end-of-file, which exits shells and many interactive programs.
Practical tasks
Common use cases
Interrupt a running command
Stops a currently running command or script. Ctrl+C sends SIGINT to the foreground process.
Ctrl+C
Interrupt / kill running command
Ctrl+Z
Suspend (pause) running command
Ctrl+D
End of input / exit shell
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
ping google.com
bg
fg
Walkthrough
Examples with explanations
# Stop a running command:
Ctrl+C
# Suspend ping, then resume:
ping google.com
Ctrl+Z
bg # resume in background
fg # bring back to foreground
Reference
Common options and variations
| Command or option | Use |
|---|---|
Ctrl+C | Interrupt / kill running command |
Ctrl+Z | Suspend (pause) running command |
Ctrl+D | End of input / exit shell |
Ctrl+\ | Force quit with core dump (drastic) |
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 | Ctrl+C |
Same command on this distribution. |
| Fedora | same command | Ctrl+C |
Same command on this distribution. |
| Arch | same command | Ctrl+C |
Same command on this distribution. |
Keep learning