The Wayback Machine - https://web.archive.org/web/20230512160218/https://www.geeksforgeeks.org/while-command-in-linux-with-example/
Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

while command in Linux with example

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

while command in Linux is used to repeatedly execute a set of command as long as the COMMAND returns true. The test command is given and all other commands are executed till the given command’s result satisfies, when the command’s result become false, the control will be out from the while command.

Syntax:

while COMMANDS; do COMMANDS; done

Example:

Option:

  • help while : It displays help information.

My Personal Notes arrow_drop_up
Last Updated : 27 May, 2019
Like Article
Save Article
Similar Reads