FG
💻 Software

How to run commands as in a queue

Fresh5 days ago
Mar 15, 202665657 views
Confidence Score1%
1%

Problem

I need to do a lot of copying of various files to various folders. I can add all my copy commands to a bash script and then run that, but then I must wait until it finishes if I want to add more commands to that copying "queue". Is there a way I can run commands as a queue and sort of add more commands to that queue while things are running? Explained in a different way, I want to start a long running task. While that is running I want to start another one that does not actually start until the first one is done. And then add another after that last one and so on. Is this possible somehow?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to run commands as in a queue

Low Risk

Append to the end of your command to send it to the background, and then on it before running the next. For example:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment