An administrator has started a lengthy data-analysis script in the foreground of their terminal. They now need to start another task but realize the script will take several more hours to complete. Which of the following commands should the administrator use to move the currently running script into the background so they can continue using the current terminal session?
Use the jobs command to automatically move the script to the background.
Stop the script with Ctrl+Z and then move it to the background with the bg command.
Press Ctrl+D to send the script to the background and free up the terminal.
Press Ctrl+C to move the running script to the background.
The bg command resumes a job in the background, but the job must first be stopped. Pressing Ctrl+Z sends SIGTSTP, which suspends the foreground process and returns control of the terminal to the shell. Running bg then resumes that suspended job in the background, freeing the terminal for other work. The incorrect choices either list jobs (jobs), terminate the script (Ctrl+C), or send an EOF/log out of the shell (Ctrl+D).
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `Ctrl+Z` command do in a terminal?
Open an interactive chat with Bash
What is the purpose of the `jobs` command?
Open an interactive chat with Bash
What happens if you use the `Ctrl+C` command on a running process?