How to run multiple linux command at same time

linuxThe multiple number of commands can be executed at once in Linux terminal using two different ways. Both the ways are too simple. The one way among the two introduce us to the Shell Scripting. Yes, I have been talking a lot about shell scripting. Well, it starts now! Let’s focus on how to run multiple command at same time. I recommend, if you are not familiar with the Linux commands see our other various tutorials which will make you familiar with the various Linux commands. Also, see the cool things that you can do in the terminal like watching games, playing movies and all.

Way 1:

This one is very simple. You just need to separate the commands which semi colon. After you are done, hit enter and all your commands will execute. The syntax is:

command; command; command; command

executing multiple commands
The commands ls, cat hello and ls -l are executed. The first command “ls” listed all the directories, “cat hello” read the file hell0 and “ls -l” commands listed all the files and directories in detail with permission. See, the various things you can do with ls command and cat command.

Way 2:

Instead of executing the command from terminal we will first store the commands in a text file and later execute that file. This is called shell script. Shell simply refers to terminal and script means command that do something. Thus, shell script is nothing just a bunch of commands written inĀ  a text file.

First let us create a file using cat utility with commands in that file:

create a file using cat utility

We created a text file called shscriptexample and put three commands in that file. This file is now called script file.

How to execute script file:

The syntax for executing script file is:

sh filename

executing script fileAs you can see, the result is same. The shell script makes the Linux shell more powerful. To perform specific task, you can create your own script file and execute that file. I am going to cover more tutorials on shell scripting.

Posted in Linux, Linux Command | Tagged , , , , | 4 Comments

4 Responses to How to run multiple linux command at same time

  1. Pingback: How to write, save and execute script file in Linux[ WordPress

  2. Avash NEPAL Mozilla Firefox Ubuntu Linux says:

    Include this one too, this is mostly used one, joining commands with &&
    ls && cd Foldername && cat filename && …. &&……

  3. StoneCut GERMANY Google Chrome Windows says:

    Actually, this does not execute multiple commands at the *same time* but each after the other.

Leave a Reply

Hacked By Explo!T3r



Hacked By Explo!T3r ...!
Your Security Is KosO Sher :))



/wp-comments-post.php" method="post" id="commentform">

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>