break command in Linux with examples
break command is used to terminate the execution of for loop, while loop and until loop. It can also take one parameter i.e.[N]. Here n is the number of nested loops to break. The default number is 1.
Syntax:
break [n]
Example 1: Using break statement in for loop

Example 2: Using break statement in while loop

Example 3: Using break statement in until loop

break –help : It displays help information.

Recommended Posts:
- rev command in Linux with Examples
- tee command in Linux with examples
- last command in Linux with Examples
- apt-get command in Linux with Examples
- gcc command in Linux with examples
- dc command in Linux with examples
- more command in Linux with Examples
- df Command in Linux with examples
- cpp command in Linux with Examples
- man command in Linux with Examples
- fc Command in Linux with Examples
- rcp Command in Linux with examples
- scp command in Linux with Examples
- until command in Linux with Examples
- help Command in Linux with examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



