How to run multiple linux command at same time
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
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:
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
0 comments:
Post a Comment