Continue Command in Linux with examples Last Updated : 09 Jun, 2023 Comments Improve Suggest changes Like Article Like Report continue is a command which is used to skip the current iteration in for, while, and until loop. It is used in scripting languages and shell scripts to control the flow of executions. It takes one more parameter [N], if N is mentioned then it continues from the nth enclosing loop. The syntax for the `continue` command in Linuxcontinue or continue [N]Usage and Examples of `Continue` Command`continue` statement in for loop Our script code is mentioned below. vim for_loop.sh Creating a script name "for_loop.sh" #!/bin/bashfor i in `seq 1 10`do if (( $i==5)) then continue fi echo $idone chmod +x for_loop.sh Making our script executable ./for_loop.sh Executing Script ./for_loop.sh As we can see that continue command has skipped the `echo $i` command when i =5 and then our loop continued with the remaining iterations and prints the number 1 to 4, and 6 to 10. `continue` statement in the while loop Our script code is mentioned below. vim while_loop.sh Creating a script name "while_loop.sh" #!/bin/bashi=1while(( $i<=10))do ((++i)) if(( $i==5)) then continue fi echo $idone chmod +x while_loop.sh Making our script executable ./while_loop.sh Executing Script ./while_loop.sh As we can see the number 5 is not there in the output because the continue command prevents the script for reaching the `echo $i` command when `i` is equal to 5. `continue` statement in until loop Our script code is mentioned below. vim until_loop.sh Creating a script name "until_loop.sh" #!/bin/bashi=0until(( $i==10 ))do ((++i)) if(( $i==5 )) then continue fi echo $idone chmod +x until_loop.sh Making our script executable ./until_loop.sh Executing Script ./until_loop.sh As we can see number 5 is skipped in the output because of the `continue` command when `i` was equal to 5. `--help` option in continue command in Linux Displays help information. continue --helpcontinue --helpConclusion In this article, we have discussed the use of `continue` command which is used to skip the current iteration and jump to the next iteration. We have discussed the usage of `continue` command by taking three examples, `continue` command in while, for and until loop. With the understanding of this article a user can easily understand the working of continue command in Linux. Comment More infoAdvertise with us D DrRoot_ Follow Improve Article Tags : Technical Scripter Linux-Unix Technical Scripter 2018 linux-command Linux-Shell-Commands +1 More Similar Reads chpasswd command in Linux with examples chpasswd command is used to change password although passwd command can also do same. But it changes the password of one user at a time so for multiple users chpasswd is used. Below figure shows the use of passwd command. Using passwd we are changing the password of the guest user. Here first you ha 2 min read chroot command in Linux with examples The 'chroot' command in Linux and Unix-like systems is used to change the root directory for the current running process and its child processes. This change creates a restricted environment, often referred to as a "chroot jail" or "jailed directory," where processes are limited to accessing only fi 3 min read chrt command in Linux with examples 'chrt' command in Linux is known for manipulating the real-time attributes of a process. It sets or retrieves the real-time scheduling attributes of an existing PID, or runs the command with the given attributes. 'chrt' can help optimize process management in a Linux system, especially for applicati 4 min read chsh command in Linux with examples chsh command in Linux is used to change the user's login shell(currently login shell). Shell is an interactive user interface with an operating system and can be considered an outer layer of the operating system. The bash shell is one of the most widely used login shells in Linux. This command allow 1 min read chvt command in Linux with examples 'chvt' command in Linux systems is used to switch between the different TTY (TeleTYpewriter) terminals available. These are essentially Virtual Terminals, which are toggled when the keys "Ctrl + Alt + FunKey(1-6)" are pressed. There are usually 6 TTY terminals, and the 'chvt' command is used to swit 3 min read cksum command in Linux with examples cksum command in Linux is used to display a CRC (Cyclic Redundancy Check) value, the byte size of the file, and the name of the file to standard output. CRC is unique for each file and only changes if the file is edited. It is used to check whether the file had accidentally corrupted while transfer. 1 min read cmp Command in Linux with examples When working with Linux or UNIX systems, you may often need to compare files to check for differences. The 'cmp' command is a powerful tool that allows you to compare two files byte by byte, making it a crucial utility for developers, system administrators, and anyone needing precise file comparison 5 min read col command in Linux with Examples The col utility of Linux is excellent at stripping any reverse line feeds and instead replacing the whitespace characters with tabs wherever possible. They find it particularly handy when processing output from such commands as `nroff` and `tbl`. The `col` utility reads data from the standard input 3 min read colcrt command in Linux with examples colcrt command in Linux systems is used to format the text processor output so that it can be viewed on Cathode Ray Tube displays. It removes underlining, strike-throughs, and underscores, which can't be displayed on CRTs since only one character can be produced at a given location on the CRT screen 3 min read colrm command in Linux with examples colrm command in Linux is used for editing text in source code files, script files or regular text files. This command removes selected columns from a file. A column is defined as a single character in a line. It always starts at index 1 and not 0. If both start and end are specified, then the colum 1 min read Like