Starting a process from the command line

Updated: May 06, 2022

For example, from the shell you can type:

$ program1

This instructs the shell to start a program called program1 and to wait for it to finish. Or, you could type:

$ program2 &

This instructs the shell to start program2 without waiting for it to finish. We say that program2 is running “in the background.”

If you want to adjust the priority of a program before you start it, you could use the nice command, just like in UNIX:

$ nice program3

This instructs the shell to start program3 at a reduced priority.

Or does it?

If you look at what really happens, we told the shell to run a program called nice at the regular priority. The nice command adjusted its own priority to be lower (this is where the name “nice” comes from), and then it ran program3 at that lower priority.