Linux Semicolon

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

Linux Semicolon (;)

you can put two or more commands on the same line separated by the semicolon. All the arguments before (;) will be treated as a separate command from all the arguments after the (;). All the commands will be executed sequentially waiting for each command to finish before starting the new one.


command1 ; command2


ls ; echo a new line 

Linux semicolon

Look at the above snapshot. First we have used 'ls' and 'echo' command separately. Then we have used both of them in the same line separated by (;). In this case, both the commands are executed sequentially.

We have highlighted 'a new line' to show that it is printed just after the list.