Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run shell command and don't wait for return [duplicate]

Tags:

linux

bash

shell

Is it possible to start the execution of a command and not wait for it to return before continuing.

I.E.

commands
/usr/sbin/thing.sh    <-- Don't wait for this to return.
more commands
like image 251
Nimjox Avatar asked Dec 18 '13 23:12

Nimjox


People also ask

How do you delay a shell script?

It is as easy as typing sleep N . This will pause your script for N seconds, with N being either a positive integer or a floating point number.

How do you run a command after the previous finished in Linux?

Using the && Operator. We should note that the && operator executes the second command only if the first one returns an exit code of 0. If we want to run the next script, even if the first one fails, we can replace the && operator with the; operator, which runs the next command regardless of the exit code.

How do you repeat the last command shell?

1) Ctrl + P This is the most dependable shortcut in Linux to execute the last run command in the terminal. Just press the Ctrl and P keys together to fill the prompt with the last executed command and you are ready to go.


1 Answers

A single & symbol between commands will let each run independently without relying on the previous command having succeeded.

like image 94
worc Avatar answered Sep 24 '22 08:09

worc