How Do You Stop an Infinite Loop in Linux?
Contents You Can Also Use the True Built-in or Any Other Statement That Always Returns True. the While Loop Above Will Run Indefinitely. You Can Terminate the...
Contents
You can also use the true built-in or any other statement that always returns true. The while loop above will run indefinitely. You can terminate the loop by pressing CTRL+C .
How do you stop an infinite loop in Linux terminal?
Try Ctrl+D. If that doesn’t work then open a new terminal and ps aux | grep command where command is the name of the script you wrote and then kill the pid that is returned. Show activity on this post. And you just echo 1 > mytestfile , if you want to stop the loop.
Must Read
How do you stop an infinite loop?
To stop, you have to break the endless loop, which can be done by pressing Ctrl+C.