Why can't I see the “wget” job when I execute it in the background?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
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
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
2
You can see it withps -p 31754
– RoVo
Jan 11 at 13:24
Jjobs
only works for the (this) shell job control (namely&
annotation, ctrl-z orbg
commamd). General process listing (ps -a
will show it)
– eckes
Jan 11 at 19:23
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
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
edited Jan 11 at 13:30
Kusalananda♦
141k17263439
141k17263439
asked Jan 11 at 13:08
floydfloyd
1434
1434
2
You can see it withps -p 31754
– RoVo
Jan 11 at 13:24
Jjobs
only works for the (this) shell job control (namely&
annotation, ctrl-z orbg
commamd). General process listing (ps -a
will show it)
– eckes
Jan 11 at 19:23
add a comment |
2
You can see it withps -p 31754
– RoVo
Jan 11 at 13:24
Jjobs
only works for the (this) shell job control (namely&
annotation, ctrl-z orbg
commamd). General process listing (ps -a
will show it)
– eckes
Jan 11 at 19:23
2
2
You can see it with
ps -p 31754
– RoVo
Jan 11 at 13:24
You can see it with
ps -p 31754
– RoVo
Jan 11 at 13:24
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
Jan 11 at 19:23
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
Jan 11 at 19:23
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
Jan 11 at 13:42
@user2497 Yes, see updated answer.
– Kusalananda♦
Jan 11 at 15:28
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♦
Jan 11 at 13:25
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.
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda♦
Jan 11 at 13:28
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
});
}
});
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
Jan 11 at 13:42
@user2497 Yes, see updated answer.
– Kusalananda♦
Jan 11 at 15:28
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
Jan 11 at 13:42
@user2497 Yes, see updated answer.
– Kusalananda♦
Jan 11 at 15:28
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 Jan 12 at 8:09
answered Jan 11 at 13:20
Kusalananda♦Kusalananda
141k17263439
141k17263439
1
it forks a child and the parent exits
– user2497
Jan 11 at 13:42
@user2497 Yes, see updated answer.
– Kusalananda♦
Jan 11 at 15:28
add a comment |
1
it forks a child and the parent exits
– user2497
Jan 11 at 13:42
@user2497 Yes, see updated answer.
– Kusalananda♦
Jan 11 at 15:28
1
1
it forks a child and the parent exits
– user2497
Jan 11 at 13:42
it forks a child and the parent exits
– user2497
Jan 11 at 13:42
@user2497 Yes, see updated answer.
– Kusalananda♦
Jan 11 at 15:28
@user2497 Yes, see updated answer.
– Kusalananda♦
Jan 11 at 15:28
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♦
Jan 11 at 13:25
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♦
Jan 11 at 13:25
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 Jan 11 at 13:20
ctrl-alt-delorctrl-alt-delor
12.4k52662
12.4k52662
3
It's-bq
, i.e.-b
and-q
, not-bg
.
– Kusalananda♦
Jan 11 at 13:25
add a comment |
3
It's-bq
, i.e.-b
and-q
, not-bg
.
– Kusalananda♦
Jan 11 at 13:25
3
3
It's
-bq
, i.e. -b
and -q
, not -bg
.– Kusalananda♦
Jan 11 at 13:25
It's
-bq
, i.e. -b
and -q
, not -bg
.– Kusalananda♦
Jan 11 at 13:25
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.
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda♦
Jan 11 at 13:28
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.
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda♦
Jan 11 at 13:28
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.
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.
answered Jan 11 at 13:27
DaselDasel
45518
45518
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda♦
Jan 11 at 13:28
add a comment |
ps
has a-p
option that can be used to query a specific PID, or one may usepgrep wget
.
– Kusalananda♦
Jan 11 at 13:28
ps
has a -p
option that can be used to query a specific PID, or one may use pgrep wget
.– Kusalananda♦
Jan 11 at 13:28
ps
has a -p
option that can be used to query a specific PID, or one may use pgrep wget
.– Kusalananda♦
Jan 11 at 13:28
add a comment |
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
Jan 11 at 13:24
Jjobs
only works for the (this) shell job control (namely&
annotation, ctrl-z orbg
commamd). General process listing (ps -a
will show it)– eckes
Jan 11 at 19:23