Aug
22nd
Sat
permalink

Job and Process Control

any_command &

Run any command in the background

ps -xaf (or xafu or xef depending on OS and distro)

Pretty complete and hierarchical list of currently running processes with their process ID (PID) numbers.

<Ctrl>z

Send the current process to the background.

jobs

List my background or stopped processes and show their job numbers.

fg job_number

Bring a background or stopped process to the foreground.

bg job_number

Place a process in the background, so it is exactly as if it had been started with &. This will restart a stopped background process. The current foreground process can often be stopped with z. If you have stopped or background jobs, you have to type exit twice in row to log out.

<Ctrl>c
Kill the current process

<Ctrl>d
Send [End-of-File] to the current process.

<Ctrl>s
Stop data transfer to the terminal.

<Ctrl>q
Resume data transfer to the terminal.