Why can't I see the “wget” job when I execute it in the background?
I use wget
command in the background like this
wget -bq
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).
command-line wget background-process job-control
New contributor
add a comment |
I use wget
command in the background like this
wget -bq
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).
command-line wget background-process job-control
New contributor
2
You can see it withps -p 31754
– RoVo
2 days ago
Jjobs
only works for the (this) shell job control (namely&
annotation, ctrl-z orbg
commamd). General process listing (ps -a
will show it)
– eckes
2 days ago
add a comment |
I use wget
command in the background like this
wget -bq
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).
command-line wget background-process job-control
New contributor
I use wget
command in the background like this
wget -bq
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).
command-line wget background-process job-control
command-line wget background-process job-control
New contributor
New contributor
edited 2 days ago
Kusalananda
124k16233384
124k16233384
New contributor
asked 2 days ago
floydfloyd
1433
1433
New contributor
New contributor
2
You can see it withps -p 31754
– RoVo
2 days ago
Jjobs
only works for the (this) shell job control (namely&
annotation, ctrl-z orbg
commamd). General process listing (ps -a
will show it)
– eckes
2 days ago
add a comment |
2
You can see it withps -p 31754
– RoVo
2 days ago
Jjobs
only works for the (this) shell job control (namely&
annotation, ctrl-z orbg
commamd). General process listing (ps -a
will show it)
– eckes
2 days ago
2
2
You can see it with
ps -p 31754
– RoVo
2 days ago
You can see it with
ps -p 31754
– RoVo
2 days ago
Jjobs
only works for the (this) shell job control (namely &
annotation, ctrl-z or bg
commamd). General process listing (ps -a
will show it)– eckes
2 days ago
Jjobs
only works for the (this) shell job control (namely &
annotation, ctrl-z or bg
commamd). General process listing (ps -a
will show it)– eckes
2 days ago
add a comment |
3 Answers
3
active
oldest
votes
When using wget
with -b
or --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 jobs
.
To run 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 -q
or --quiet
.
1
it forks a child and the parent exits
– user2497
2 days ago
@user2497 Yes, see updated answer.
– Kusalananda
2 days ago
add a comment |
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.
3
It's-bq
, i.e.-b
and-q
, not-bg
.
– Kusalananda
2 days ago
add a comment |
The process with pid 31754 exists; if you type ps -e |grep 31754
but as it is not a job that can be moved to the foreground again, it is not displayed by the jobs command. wget -bq
automatically send the output to the background without options to move it to the foreground again.
New contributor
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda
2 days ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
floyd is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493943%2fwhy-cant-i-see-the-wget-job-when-i-execute-it-in-the-background%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
When using wget
with -b
or --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 jobs
.
To run 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 -q
or --quiet
.
1
it forks a child and the parent exits
– user2497
2 days ago
@user2497 Yes, see updated answer.
– Kusalananda
2 days ago
add a comment |
When using wget
with -b
or --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 jobs
.
To run 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 -q
or --quiet
.
1
it forks a child and the parent exits
– user2497
2 days ago
@user2497 Yes, see updated answer.
– Kusalananda
2 days ago
add a comment |
When using wget
with -b
or --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 jobs
.
To run 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 -q
or --quiet
.
When using wget
with -b
or --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 jobs
.
To run 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 -q
or --quiet
.
edited yesterday
answered 2 days ago
KusalanandaKusalananda
124k16233384
124k16233384
1
it forks a child and the parent exits
– user2497
2 days ago
@user2497 Yes, see updated answer.
– Kusalananda
2 days ago
add a comment |
1
it forks a child and the parent exits
– user2497
2 days ago
@user2497 Yes, see updated answer.
– Kusalananda
2 days ago
1
1
it forks a child and the parent exits
– user2497
2 days ago
it forks a child and the parent exits
– user2497
2 days ago
@user2497 Yes, see updated answer.
– Kusalananda
2 days ago
@user2497 Yes, see updated answer.
– Kusalananda
2 days ago
add a comment |
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.
3
It's-bq
, i.e.-b
and-q
, not-bg
.
– Kusalananda
2 days ago
add a comment |
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.
3
It's-bq
, i.e.-b
and-q
, not-bg
.
– Kusalananda
2 days ago
add a comment |
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.
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.
answered 2 days ago
ctrl-alt-delorctrl-alt-delor
11k41958
11k41958
3
It's-bq
, i.e.-b
and-q
, not-bg
.
– Kusalananda
2 days ago
add a comment |
3
It's-bq
, i.e.-b
and-q
, not-bg
.
– Kusalananda
2 days ago
3
3
It's
-bq
, i.e. -b
and -q
, not -bg
.– Kusalananda
2 days ago
It's
-bq
, i.e. -b
and -q
, not -bg
.– Kusalananda
2 days ago
add a comment |
The process with pid 31754 exists; if you type ps -e |grep 31754
but as it is not a job that can be moved to the foreground again, it is not displayed by the jobs command. wget -bq
automatically send the output to the background without options to move it to the foreground again.
New contributor
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda
2 days ago
add a comment |
The process with pid 31754 exists; if you type ps -e |grep 31754
but as it is not a job that can be moved to the foreground again, it is not displayed by the jobs command. wget -bq
automatically send the output to the background without options to move it to the foreground again.
New contributor
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda
2 days ago
add a comment |
The process with pid 31754 exists; if you type ps -e |grep 31754
but as it is not a job that can be moved to the foreground again, it is not displayed by the jobs command. wget -bq
automatically send the output to the background without options to move it to the foreground again.
New contributor
The process with pid 31754 exists; if you type ps -e |grep 31754
but as it is not a job that can be moved to the foreground again, it is not displayed by the jobs command. wget -bq
automatically send the output to the background without options to move it to the foreground again.
New contributor
New contributor
answered 2 days ago
DaselDasel
3917
3917
New contributor
New contributor
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda
2 days ago
add a comment |
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda
2 days ago
ps
has a -p
option that can be used to query a specific PID, or one may use pgrep wget
.– Kusalananda
2 days ago
ps
has a -p
option that can be used to query a specific PID, or one may use pgrep wget
.– Kusalananda
2 days ago
add a comment |
floyd is a new contributor. Be nice, and check out our Code of Conduct.
floyd is a new contributor. Be nice, and check out our Code of Conduct.
floyd is a new contributor. Be nice, and check out our Code of Conduct.
floyd is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493943%2fwhy-cant-i-see-the-wget-job-when-i-execute-it-in-the-background%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
You can see it with
ps -p 31754
– RoVo
2 days ago
Jjobs
only works for the (this) shell job control (namely&
annotation, ctrl-z orbg
commamd). General process listing (ps -a
will show it)– eckes
2 days ago