How Do You Exit 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 loop by pressing CTRL+C .

How do you exit an infinite loop?

To stop, you have to break the endless loop, which can be done by pressing Ctrl+C.

What is the shortcut key to terminate infinite loop?

You can press Ctrl + C .

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest