How to check whether a bash command is run in background?

Viewed 42

I run an installation command in linux that immediately after hitting enter returns me back to the prompt but continues to install.

Does that mean it is run in the background or does it merely mean there is no print to the stdout?

My final goal is to perform a wait on the command but I can't understand if it's run in background or not.

1 Answers

It's not really up to you, it depends on the command. By default you wait for it, but if it wants to "run in the background", it can fork and return to you. You have to find a solution on a per-command basis - it would be best if you had a clearer goal, such as "I want to run apt install some_app and wait for it to finish".

Related