How Do You Make an Indefinite Linux Command Go to the Background So That You Have Another Prompt?

Problem scenario
You want a non-terminating (or hanging) Linux command that never finishes to go to the background. You want to use the next command line prompt. The process starts from a command you issue at the command line. How do you do you get to the next prompt?

Solution

  1. This will suspend the process momentarily. Hold control and tap "z." Ctrl-z
  1. The above command will result in something like this:
    [555]+ Stopped python3 goodprogram.py

Craft a command like this, but replace 555 with the integer in the output of the command above:

bg 555
# Normally the value will be "1" -- not "555"

Leave a comment

Your email address will not be published. Required fields are marked *