I tried to test "jobs" command on Ubuntu 16.04. It seems that there is no "jobs" command on my system. I did what I learned like "whereis jobs", "whatis jobs", "which jobs", but Ubuntu replies "jobs:", "jobs: nothing appropriate", "", respectively. I also tried "sudo apt-get install jobs". Not successful. What should I do to make jobs command working on my Ubuntu 16.04 system. Thanks for reading.
You can only use "jobs" if your shell has processes running in background (either using ctrl+z or by ampersand [&] sign after the command. i.e. top &). the command "jobs" shows nothing if your shell has no corresponding background processes running.
"jobs" will show you the "full" command that is running as well as the job number. You may also use the "ps" command to see shell's jobs running in the background along with their PIDs. "ps" command shows only the command keyword that is running (not the parameters) nor the job number (only PID). You can't usually distinction foreground and background process with "ps" command because it shows you all processes running with your current active shell.
According to the manual, the monitor option is "on by default for interactive shells on systems that support it".
To see if it's on, type
set -o
and look for themonitor
line. If it is set tooff
, job control is disabled. Try typingset -m
(orset -o monitor
) to enable it. If that doesn't work, maybe your system doesn't support background jobs.