Why can't I see the “wget” job when I execute it in the background?












8















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).










share|improve this question









New contributor




floyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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 or bg commamd). General process listing (ps -a will show it)

    – eckes
    2 days ago
















8















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).










share|improve this question









New contributor




floyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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 or bg commamd). General process listing (ps -a will show it)

    – eckes
    2 days ago














8












8








8


1






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).










share|improve this question









New contributor




floyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question









New contributor




floyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




floyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago









Kusalananda

124k16233384




124k16233384






New contributor




floyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









floydfloyd

1433




1433




New contributor




floyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





floyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






floyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 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 or bg commamd). General process listing (ps -a will show it)

    – eckes
    2 days ago














  • 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 or bg 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










3 Answers
3






active

oldest

votes


















19














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.






share|improve this answer





















  • 1





    it forks a child and the parent exits

    – user2497
    2 days ago











  • @user2497 Yes, see updated answer.

    – Kusalananda
    2 days ago



















6














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.






share|improve this answer



















  • 3





    It's -bq, i.e. -b and -q, not -bg.

    – Kusalananda
    2 days ago



















2














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.






share|improve this answer








New contributor




Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • ps has a -p option that can be used to query a specific PID, or one may use pgrep wget.

    – Kusalananda
    2 days ago











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.










draft saved

draft discarded


















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









19














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.






share|improve this answer





















  • 1





    it forks a child and the parent exits

    – user2497
    2 days ago











  • @user2497 Yes, see updated answer.

    – Kusalananda
    2 days ago
















19














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.






share|improve this answer





















  • 1





    it forks a child and the parent exits

    – user2497
    2 days ago











  • @user2497 Yes, see updated answer.

    – Kusalananda
    2 days ago














19












19








19







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.






share|improve this answer















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.







share|improve this answer














share|improve this answer



share|improve this answer








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














  • 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













6














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.






share|improve this answer



















  • 3





    It's -bq, i.e. -b and -q, not -bg.

    – Kusalananda
    2 days ago
















6














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.






share|improve this answer



















  • 3





    It's -bq, i.e. -b and -q, not -bg.

    – Kusalananda
    2 days ago














6












6








6







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










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














  • 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











2














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.






share|improve this answer








New contributor




Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • ps has a -p option that can be used to query a specific PID, or one may use pgrep wget.

    – Kusalananda
    2 days ago
















2














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.






share|improve this answer








New contributor




Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • ps has a -p option that can be used to query a specific PID, or one may use pgrep wget.

    – Kusalananda
    2 days ago














2












2








2







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.






share|improve this answer








New contributor




Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










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.







share|improve this answer








New contributor




Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer






New contributor




Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 2 days ago









DaselDasel

3917




3917




New contributor




Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • 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

















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










floyd is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

Origin of the phrase “under your belt”?