wget command in the background like this
and it prints
Continuing in background, pid 31754.
But when I type the command
jobs, I don't see my job(although the downloading is not finished).
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
--background it puts itself into the background by disassociating from the current shell (by forking off a child process and terminating the parent). Since it's not the shell that puts it in the background as an asynchronous job, it will not show up as a job when you use
wget as an asynchronous (background) job in the shell, use
wget ... URL &
If you do this, you may additionally want to redirect output to some file (which
wget does automatically with
-b), or discard it by redirecting to
/dev/null, or use
Because it put it self in the background. Use
& to tell bash to put it into background, and to put it into bash's list of jobs.
Background and job control list are not the same. Bash puts all of its background processes into its jobs control list (by default), but processes can be backgrounded with out being put in the list. Only bash can put jobs in its list.
There may be advantages to the
-bg option (I don't know what). For example
ssh's background option, puts it into the background after asking for a password.