1

If you run say Nemo from bash shell, you're not going to be able to execute any other commands from that shell until you end the Nemo process.

And that's my problem. I want to be able to run other commands without having to open an another shell and without having to end the started process.

9
exec Nemo

would not run Nemo in a shell sub-process, that is, it would execute Nemo in the process of the shell, so replace the shell with Nemo.

But it doesn't look like that's what you want.

What it looks like you want here is the command to run in a separate process but for the shell not to wait for that process to finish before issuing the next prompt.

For that, you'd use:

Nemo &

That runs Nemo asynchronously. When it's done from an interactive shell, Nemo is also put in background so as to be prevented from reading from the terminal or from getting killed by a SIGINT if you press Ctrl+C.

Note that the command will still be in the shell's job table. You can put it back in foreground with fg. The shell will also try to kill it when it exits (at least in some shells).

With some shells including bash, you can also use the disown command to tell the shell to forget about it. With zsh, you can also start it as:

Nemo &!

to start it in background and disown it straight away.

1

Do you mean how to execute a command in background?

You can do it by finishing such command with "&"

Example:

$ nemo &

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.