How Do You Stop an Infinite Loop in Linux Terminal?
Contents Try Ctrl+D. How Do You Stop an Infinite Loop in Terminal? Control-C (Holding the Ctrl Key While Typing ‘C’) Should Do the Trick. How Do You Stop a...
Contents
Try Ctrl+D.
How do you stop an infinite loop in terminal?
Control-C (holding the Ctrl key while typing ‘c’) should do the trick.
How do you stop a loop in Linux?
If you want ctrl+c to stop the loop, but not terminate the script, you can place || break after whatever command you’re running. As long as the program you’re running terminates on ctrl+c, this works great. If you’re in nested loop, you can use “break 2” to get out of two levels, etc.