sleep command using screen command is not displayed in ps The 2019 Stack Overflow Developer Survey Results Are InUnable to 'stuff' commands into a created 'screen' immediately after creating itHow to tell if terminal session is running within screenWhy do I get “screen is terminating” without root?Running background process with screen command in xshellscreen command not showing status barCapturing screen of “perf top” or other interactive programsbash - get pid for a script using the script filenameStart detached screen session with more than 80 columns?Unable to initiate screen sessionHow do I un-freeze my vim session under screen

Deal with toxic manager when you can't quit

The phrase "to the numbers born"?

Did any laptop computers have a built-in 5 1/4 inch floppy drive?

Output the Arecibo Message

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Why doesn't UInt have a toDouble()?

What is this business jet?

Can a flute soloist sit?

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

How do PCB vias affect signal quality?

Can we generate random numbers using irrational numbers like π and e?

Keeping a retro style to sci-fi spaceships?

Why does the nucleus not repel itself?

"as much details as you can remember"

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

What do these terms in Caesar's Gallic Wars mean?

Button changing its text & action. Good or terrible?

Old scifi movie from the 50s or 60s with men in solid red uniforms who interrogate a spy from the past

Correct punctuation for showing a character's confusion

Cooking pasta in a water boiler

Dropping list elements from nested list after evaluation

What information about me do stores get via my credit card?



sleep command using screen command is not displayed in ps



The 2019 Stack Overflow Developer Survey Results Are InUnable to 'stuff' commands into a created 'screen' immediately after creating itHow to tell if terminal session is running within screenWhy do I get “screen is terminating” without root?Running background process with screen command in xshellscreen command not showing status barCapturing screen of “perf top” or other interactive programsbash - get pid for a script using the script filenameStart detached screen session with more than 80 columns?Unable to initiate screen sessionHow do I un-freeze my vim session under screen



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4















I'm running the sleep command in terminal using screen and in detached mode.

Once the screen immediately returns, I'm running ps command to verify the sleep is running.



$ screen -d -m 'sleep 2m'
[raj@localhost ~]$ ps
PID TTY TIME CMD
22795 pts/0 00:00:00 bash
22869 pts/0 00:00:00 ps


But the command didn't show sleep. What is that I'm doing wrong here?










share|improve this question
























  • why would you want to run sleep through a detached screen ? couldn’t you just run it as sleep 2m & directly from your shell ? besides, ps alone shows only processes belonging to your terminal window, while whatever you run through screen will belong to a different virtual terminal

    – LL3
    2 days ago












  • @LL3 - I'm doing it as a poc to run a command from remote machine using screen and detach from screen. I have tried using ps -a | grep sleep still it is not showing any new process running sleep.

    – Rajkumar Natarajan
    2 days ago


















4















I'm running the sleep command in terminal using screen and in detached mode.

Once the screen immediately returns, I'm running ps command to verify the sleep is running.



$ screen -d -m 'sleep 2m'
[raj@localhost ~]$ ps
PID TTY TIME CMD
22795 pts/0 00:00:00 bash
22869 pts/0 00:00:00 ps


But the command didn't show sleep. What is that I'm doing wrong here?










share|improve this question
























  • why would you want to run sleep through a detached screen ? couldn’t you just run it as sleep 2m & directly from your shell ? besides, ps alone shows only processes belonging to your terminal window, while whatever you run through screen will belong to a different virtual terminal

    – LL3
    2 days ago












  • @LL3 - I'm doing it as a poc to run a command from remote machine using screen and detach from screen. I have tried using ps -a | grep sleep still it is not showing any new process running sleep.

    – Rajkumar Natarajan
    2 days ago














4












4








4








I'm running the sleep command in terminal using screen and in detached mode.

Once the screen immediately returns, I'm running ps command to verify the sleep is running.



$ screen -d -m 'sleep 2m'
[raj@localhost ~]$ ps
PID TTY TIME CMD
22795 pts/0 00:00:00 bash
22869 pts/0 00:00:00 ps


But the command didn't show sleep. What is that I'm doing wrong here?










share|improve this question
















I'm running the sleep command in terminal using screen and in detached mode.

Once the screen immediately returns, I'm running ps command to verify the sleep is running.



$ screen -d -m 'sleep 2m'
[raj@localhost ~]$ ps
PID TTY TIME CMD
22795 pts/0 00:00:00 bash
22869 pts/0 00:00:00 ps


But the command didn't show sleep. What is that I'm doing wrong here?







scripting gnu-screen ps






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Monty Harder

22415




22415










asked 2 days ago









Rajkumar NatarajanRajkumar Natarajan

1447




1447












  • why would you want to run sleep through a detached screen ? couldn’t you just run it as sleep 2m & directly from your shell ? besides, ps alone shows only processes belonging to your terminal window, while whatever you run through screen will belong to a different virtual terminal

    – LL3
    2 days ago












  • @LL3 - I'm doing it as a poc to run a command from remote machine using screen and detach from screen. I have tried using ps -a | grep sleep still it is not showing any new process running sleep.

    – Rajkumar Natarajan
    2 days ago


















  • why would you want to run sleep through a detached screen ? couldn’t you just run it as sleep 2m & directly from your shell ? besides, ps alone shows only processes belonging to your terminal window, while whatever you run through screen will belong to a different virtual terminal

    – LL3
    2 days ago












  • @LL3 - I'm doing it as a poc to run a command from remote machine using screen and detach from screen. I have tried using ps -a | grep sleep still it is not showing any new process running sleep.

    – Rajkumar Natarajan
    2 days ago

















why would you want to run sleep through a detached screen ? couldn’t you just run it as sleep 2m & directly from your shell ? besides, ps alone shows only processes belonging to your terminal window, while whatever you run through screen will belong to a different virtual terminal

– LL3
2 days ago






why would you want to run sleep through a detached screen ? couldn’t you just run it as sleep 2m & directly from your shell ? besides, ps alone shows only processes belonging to your terminal window, while whatever you run through screen will belong to a different virtual terminal

– LL3
2 days ago














@LL3 - I'm doing it as a poc to run a command from remote machine using screen and detach from screen. I have tried using ps -a | grep sleep still it is not showing any new process running sleep.

– Rajkumar Natarajan
2 days ago






@LL3 - I'm doing it as a poc to run a command from remote machine using screen and detach from screen. I have tried using ps -a | grep sleep still it is not showing any new process running sleep.

– Rajkumar Natarajan
2 days ago











2 Answers
2






active

oldest

votes


















10














This was confusing to me initially as well. I then re-read the local screen man page for the SYNOPSIS -- the online man page does not give a synopsis) -- and noticed that it said:




screen [ -options ] [ cmd [ args ] ]



... which led me to believe that it wanted to see the cmd and args as independent arguments.



Since you gave that first argument as a quoted value -- 'sleep 2m' -- it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with its own argument of 2m. The screen command exited successfully (in my testing), but it did not successfully execute your command.



Use, instead:



screen -d -m sleep 2m


Instead of ps, which will only show processes associated with the current terminal (of which the SCREEN and related processes are not), use:



ps x


which will show it:



$ ps x
PID TTY STAT TIME COMMAND
# ...
7514 pts/1 Ss 0:00 -bash
7761 ? Ss 0:00 SCREEN -d -m sleep 2m
7762 pts/2 Ss+ 0:00 sleep 2m
7880 pts/1 R+ 0:00 ps x
# ...





share|improve this answer

























  • You say “screen expected the command in the first argument”, and then you show a command line where the secondary command (the command to be invoked by the primary command) is spread out over argv[3] and argv[4]. I expect that some people will be confused by this.

    – G-Man
    yesterday











  • Would it help if I said "first non-option argument"? I intended the translation to be from "'sleep 2m'" to "sleep", but I want to reduce confusion, not generate more!

    – Jeff Schaller
    yesterday






  • 1





    I suppose that would be less unclear, but not really better.  Maybe you want to say that the secondary command verb and the arguments to the secondary command must be separate arguments to the primary command, like with find -exec, sudo and xargs, and different from the way sh -c and some other commands require it.

    – G-Man
    yesterday












  • I've updated the post to include some more analysis of the commands & args. Please take a look and see if that helps, and let me know if you see any further improvements. Thank you!

    – Jeff Schaller
    yesterday











  • Very good.  I might have mentioned find -exec, sudo, xargs, and sh -c in the answer, but perhaps that would be information overload.  If we leave my second comment, I don’t believe that the answer needs any more changes.

    – G-Man
    yesterday


















0














Would using nohup suffice? It will show in ps where as running it in screen may make the process hidden within the screen process.



An example of this would be from bash..



nohup your-command &


If you want to exit this terminal session you may want to use an at job command..



at now + 1 minute

nohup your-command &

(ctrl-d)





share|improve this answer










New contributor




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




















  • (1) This is confusing.  You talk about a script and redirecting the standard output, neither of which is in the question.  On the other hand, the question features a sleep command, which your answer doesn’t mention. (2) Can you explain why you believe that nohup will help?  Do you believe that some process (e.g., sleep) is getting a hangup signal? … (Cont’d)

    – G-Man
    yesterday











  • (Cont’d) … (3) Using nohup would probably not suffice. Jeff’s answer presents two reasons why the user is not seeing the result they’re expecting. Adding nohup might be necessary also, but, by itself, it’s not likely to be enough.

    – G-Man
    yesterday











  • I’ve made it more clear. Was just pasting a real life example and hadn’t considered the confusion. Sorry.

    – Strainger
    yesterday











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



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511443%2fsleep-command-using-screen-command-is-not-displayed-in-ps%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









10














This was confusing to me initially as well. I then re-read the local screen man page for the SYNOPSIS -- the online man page does not give a synopsis) -- and noticed that it said:




screen [ -options ] [ cmd [ args ] ]



... which led me to believe that it wanted to see the cmd and args as independent arguments.



Since you gave that first argument as a quoted value -- 'sleep 2m' -- it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with its own argument of 2m. The screen command exited successfully (in my testing), but it did not successfully execute your command.



Use, instead:



screen -d -m sleep 2m


Instead of ps, which will only show processes associated with the current terminal (of which the SCREEN and related processes are not), use:



ps x


which will show it:



$ ps x
PID TTY STAT TIME COMMAND
# ...
7514 pts/1 Ss 0:00 -bash
7761 ? Ss 0:00 SCREEN -d -m sleep 2m
7762 pts/2 Ss+ 0:00 sleep 2m
7880 pts/1 R+ 0:00 ps x
# ...





share|improve this answer

























  • You say “screen expected the command in the first argument”, and then you show a command line where the secondary command (the command to be invoked by the primary command) is spread out over argv[3] and argv[4]. I expect that some people will be confused by this.

    – G-Man
    yesterday











  • Would it help if I said "first non-option argument"? I intended the translation to be from "'sleep 2m'" to "sleep", but I want to reduce confusion, not generate more!

    – Jeff Schaller
    yesterday






  • 1





    I suppose that would be less unclear, but not really better.  Maybe you want to say that the secondary command verb and the arguments to the secondary command must be separate arguments to the primary command, like with find -exec, sudo and xargs, and different from the way sh -c and some other commands require it.

    – G-Man
    yesterday












  • I've updated the post to include some more analysis of the commands & args. Please take a look and see if that helps, and let me know if you see any further improvements. Thank you!

    – Jeff Schaller
    yesterday











  • Very good.  I might have mentioned find -exec, sudo, xargs, and sh -c in the answer, but perhaps that would be information overload.  If we leave my second comment, I don’t believe that the answer needs any more changes.

    – G-Man
    yesterday















10














This was confusing to me initially as well. I then re-read the local screen man page for the SYNOPSIS -- the online man page does not give a synopsis) -- and noticed that it said:




screen [ -options ] [ cmd [ args ] ]



... which led me to believe that it wanted to see the cmd and args as independent arguments.



Since you gave that first argument as a quoted value -- 'sleep 2m' -- it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with its own argument of 2m. The screen command exited successfully (in my testing), but it did not successfully execute your command.



Use, instead:



screen -d -m sleep 2m


Instead of ps, which will only show processes associated with the current terminal (of which the SCREEN and related processes are not), use:



ps x


which will show it:



$ ps x
PID TTY STAT TIME COMMAND
# ...
7514 pts/1 Ss 0:00 -bash
7761 ? Ss 0:00 SCREEN -d -m sleep 2m
7762 pts/2 Ss+ 0:00 sleep 2m
7880 pts/1 R+ 0:00 ps x
# ...





share|improve this answer

























  • You say “screen expected the command in the first argument”, and then you show a command line where the secondary command (the command to be invoked by the primary command) is spread out over argv[3] and argv[4]. I expect that some people will be confused by this.

    – G-Man
    yesterday











  • Would it help if I said "first non-option argument"? I intended the translation to be from "'sleep 2m'" to "sleep", but I want to reduce confusion, not generate more!

    – Jeff Schaller
    yesterday






  • 1





    I suppose that would be less unclear, but not really better.  Maybe you want to say that the secondary command verb and the arguments to the secondary command must be separate arguments to the primary command, like with find -exec, sudo and xargs, and different from the way sh -c and some other commands require it.

    – G-Man
    yesterday












  • I've updated the post to include some more analysis of the commands & args. Please take a look and see if that helps, and let me know if you see any further improvements. Thank you!

    – Jeff Schaller
    yesterday











  • Very good.  I might have mentioned find -exec, sudo, xargs, and sh -c in the answer, but perhaps that would be information overload.  If we leave my second comment, I don’t believe that the answer needs any more changes.

    – G-Man
    yesterday













10












10








10







This was confusing to me initially as well. I then re-read the local screen man page for the SYNOPSIS -- the online man page does not give a synopsis) -- and noticed that it said:




screen [ -options ] [ cmd [ args ] ]



... which led me to believe that it wanted to see the cmd and args as independent arguments.



Since you gave that first argument as a quoted value -- 'sleep 2m' -- it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with its own argument of 2m. The screen command exited successfully (in my testing), but it did not successfully execute your command.



Use, instead:



screen -d -m sleep 2m


Instead of ps, which will only show processes associated with the current terminal (of which the SCREEN and related processes are not), use:



ps x


which will show it:



$ ps x
PID TTY STAT TIME COMMAND
# ...
7514 pts/1 Ss 0:00 -bash
7761 ? Ss 0:00 SCREEN -d -m sleep 2m
7762 pts/2 Ss+ 0:00 sleep 2m
7880 pts/1 R+ 0:00 ps x
# ...





share|improve this answer















This was confusing to me initially as well. I then re-read the local screen man page for the SYNOPSIS -- the online man page does not give a synopsis) -- and noticed that it said:




screen [ -options ] [ cmd [ args ] ]



... which led me to believe that it wanted to see the cmd and args as independent arguments.



Since you gave that first argument as a quoted value -- 'sleep 2m' -- it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with its own argument of 2m. The screen command exited successfully (in my testing), but it did not successfully execute your command.



Use, instead:



screen -d -m sleep 2m


Instead of ps, which will only show processes associated with the current terminal (of which the SCREEN and related processes are not), use:



ps x


which will show it:



$ ps x
PID TTY STAT TIME COMMAND
# ...
7514 pts/1 Ss 0:00 -bash
7761 ? Ss 0:00 SCREEN -d -m sleep 2m
7762 pts/2 Ss+ 0:00 sleep 2m
7880 pts/1 R+ 0:00 ps x
# ...






share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday

























answered 2 days ago









Jeff SchallerJeff Schaller

45k1164147




45k1164147












  • You say “screen expected the command in the first argument”, and then you show a command line where the secondary command (the command to be invoked by the primary command) is spread out over argv[3] and argv[4]. I expect that some people will be confused by this.

    – G-Man
    yesterday











  • Would it help if I said "first non-option argument"? I intended the translation to be from "'sleep 2m'" to "sleep", but I want to reduce confusion, not generate more!

    – Jeff Schaller
    yesterday






  • 1





    I suppose that would be less unclear, but not really better.  Maybe you want to say that the secondary command verb and the arguments to the secondary command must be separate arguments to the primary command, like with find -exec, sudo and xargs, and different from the way sh -c and some other commands require it.

    – G-Man
    yesterday












  • I've updated the post to include some more analysis of the commands & args. Please take a look and see if that helps, and let me know if you see any further improvements. Thank you!

    – Jeff Schaller
    yesterday











  • Very good.  I might have mentioned find -exec, sudo, xargs, and sh -c in the answer, but perhaps that would be information overload.  If we leave my second comment, I don’t believe that the answer needs any more changes.

    – G-Man
    yesterday

















  • You say “screen expected the command in the first argument”, and then you show a command line where the secondary command (the command to be invoked by the primary command) is spread out over argv[3] and argv[4]. I expect that some people will be confused by this.

    – G-Man
    yesterday











  • Would it help if I said "first non-option argument"? I intended the translation to be from "'sleep 2m'" to "sleep", but I want to reduce confusion, not generate more!

    – Jeff Schaller
    yesterday






  • 1





    I suppose that would be less unclear, but not really better.  Maybe you want to say that the secondary command verb and the arguments to the secondary command must be separate arguments to the primary command, like with find -exec, sudo and xargs, and different from the way sh -c and some other commands require it.

    – G-Man
    yesterday












  • I've updated the post to include some more analysis of the commands & args. Please take a look and see if that helps, and let me know if you see any further improvements. Thank you!

    – Jeff Schaller
    yesterday











  • Very good.  I might have mentioned find -exec, sudo, xargs, and sh -c in the answer, but perhaps that would be information overload.  If we leave my second comment, I don’t believe that the answer needs any more changes.

    – G-Man
    yesterday
















You say “screen expected the command in the first argument”, and then you show a command line where the secondary command (the command to be invoked by the primary command) is spread out over argv[3] and argv[4]. I expect that some people will be confused by this.

– G-Man
yesterday





You say “screen expected the command in the first argument”, and then you show a command line where the secondary command (the command to be invoked by the primary command) is spread out over argv[3] and argv[4]. I expect that some people will be confused by this.

– G-Man
yesterday













Would it help if I said "first non-option argument"? I intended the translation to be from "'sleep 2m'" to "sleep", but I want to reduce confusion, not generate more!

– Jeff Schaller
yesterday





Would it help if I said "first non-option argument"? I intended the translation to be from "'sleep 2m'" to "sleep", but I want to reduce confusion, not generate more!

– Jeff Schaller
yesterday




1




1





I suppose that would be less unclear, but not really better.  Maybe you want to say that the secondary command verb and the arguments to the secondary command must be separate arguments to the primary command, like with find -exec, sudo and xargs, and different from the way sh -c and some other commands require it.

– G-Man
yesterday






I suppose that would be less unclear, but not really better.  Maybe you want to say that the secondary command verb and the arguments to the secondary command must be separate arguments to the primary command, like with find -exec, sudo and xargs, and different from the way sh -c and some other commands require it.

– G-Man
yesterday














I've updated the post to include some more analysis of the commands & args. Please take a look and see if that helps, and let me know if you see any further improvements. Thank you!

– Jeff Schaller
yesterday





I've updated the post to include some more analysis of the commands & args. Please take a look and see if that helps, and let me know if you see any further improvements. Thank you!

– Jeff Schaller
yesterday













Very good.  I might have mentioned find -exec, sudo, xargs, and sh -c in the answer, but perhaps that would be information overload.  If we leave my second comment, I don’t believe that the answer needs any more changes.

– G-Man
yesterday





Very good.  I might have mentioned find -exec, sudo, xargs, and sh -c in the answer, but perhaps that would be information overload.  If we leave my second comment, I don’t believe that the answer needs any more changes.

– G-Man
yesterday













0














Would using nohup suffice? It will show in ps where as running it in screen may make the process hidden within the screen process.



An example of this would be from bash..



nohup your-command &


If you want to exit this terminal session you may want to use an at job command..



at now + 1 minute

nohup your-command &

(ctrl-d)





share|improve this answer










New contributor




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




















  • (1) This is confusing.  You talk about a script and redirecting the standard output, neither of which is in the question.  On the other hand, the question features a sleep command, which your answer doesn’t mention. (2) Can you explain why you believe that nohup will help?  Do you believe that some process (e.g., sleep) is getting a hangup signal? … (Cont’d)

    – G-Man
    yesterday











  • (Cont’d) … (3) Using nohup would probably not suffice. Jeff’s answer presents two reasons why the user is not seeing the result they’re expecting. Adding nohup might be necessary also, but, by itself, it’s not likely to be enough.

    – G-Man
    yesterday











  • I’ve made it more clear. Was just pasting a real life example and hadn’t considered the confusion. Sorry.

    – Strainger
    yesterday















0














Would using nohup suffice? It will show in ps where as running it in screen may make the process hidden within the screen process.



An example of this would be from bash..



nohup your-command &


If you want to exit this terminal session you may want to use an at job command..



at now + 1 minute

nohup your-command &

(ctrl-d)





share|improve this answer










New contributor




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




















  • (1) This is confusing.  You talk about a script and redirecting the standard output, neither of which is in the question.  On the other hand, the question features a sleep command, which your answer doesn’t mention. (2) Can you explain why you believe that nohup will help?  Do you believe that some process (e.g., sleep) is getting a hangup signal? … (Cont’d)

    – G-Man
    yesterday











  • (Cont’d) … (3) Using nohup would probably not suffice. Jeff’s answer presents two reasons why the user is not seeing the result they’re expecting. Adding nohup might be necessary also, but, by itself, it’s not likely to be enough.

    – G-Man
    yesterday











  • I’ve made it more clear. Was just pasting a real life example and hadn’t considered the confusion. Sorry.

    – Strainger
    yesterday













0












0








0







Would using nohup suffice? It will show in ps where as running it in screen may make the process hidden within the screen process.



An example of this would be from bash..



nohup your-command &


If you want to exit this terminal session you may want to use an at job command..



at now + 1 minute

nohup your-command &

(ctrl-d)





share|improve this answer










New contributor




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










Would using nohup suffice? It will show in ps where as running it in screen may make the process hidden within the screen process.



An example of this would be from bash..



nohup your-command &


If you want to exit this terminal session you may want to use an at job command..



at now + 1 minute

nohup your-command &

(ctrl-d)






share|improve this answer










New contributor




Strainger 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








edited yesterday





















New contributor




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









answered yesterday









StraingerStrainger

11




11




New contributor




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





New contributor





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






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












  • (1) This is confusing.  You talk about a script and redirecting the standard output, neither of which is in the question.  On the other hand, the question features a sleep command, which your answer doesn’t mention. (2) Can you explain why you believe that nohup will help?  Do you believe that some process (e.g., sleep) is getting a hangup signal? … (Cont’d)

    – G-Man
    yesterday











  • (Cont’d) … (3) Using nohup would probably not suffice. Jeff’s answer presents two reasons why the user is not seeing the result they’re expecting. Adding nohup might be necessary also, but, by itself, it’s not likely to be enough.

    – G-Man
    yesterday











  • I’ve made it more clear. Was just pasting a real life example and hadn’t considered the confusion. Sorry.

    – Strainger
    yesterday

















  • (1) This is confusing.  You talk about a script and redirecting the standard output, neither of which is in the question.  On the other hand, the question features a sleep command, which your answer doesn’t mention. (2) Can you explain why you believe that nohup will help?  Do you believe that some process (e.g., sleep) is getting a hangup signal? … (Cont’d)

    – G-Man
    yesterday











  • (Cont’d) … (3) Using nohup would probably not suffice. Jeff’s answer presents two reasons why the user is not seeing the result they’re expecting. Adding nohup might be necessary also, but, by itself, it’s not likely to be enough.

    – G-Man
    yesterday











  • I’ve made it more clear. Was just pasting a real life example and hadn’t considered the confusion. Sorry.

    – Strainger
    yesterday
















(1) This is confusing.  You talk about a script and redirecting the standard output, neither of which is in the question.  On the other hand, the question features a sleep command, which your answer doesn’t mention. (2) Can you explain why you believe that nohup will help?  Do you believe that some process (e.g., sleep) is getting a hangup signal? … (Cont’d)

– G-Man
yesterday





(1) This is confusing.  You talk about a script and redirecting the standard output, neither of which is in the question.  On the other hand, the question features a sleep command, which your answer doesn’t mention. (2) Can you explain why you believe that nohup will help?  Do you believe that some process (e.g., sleep) is getting a hangup signal? … (Cont’d)

– G-Man
yesterday













(Cont’d) … (3) Using nohup would probably not suffice. Jeff’s answer presents two reasons why the user is not seeing the result they’re expecting. Adding nohup might be necessary also, but, by itself, it’s not likely to be enough.

– G-Man
yesterday





(Cont’d) … (3) Using nohup would probably not suffice. Jeff’s answer presents two reasons why the user is not seeing the result they’re expecting. Adding nohup might be necessary also, but, by itself, it’s not likely to be enough.

– G-Man
yesterday













I’ve made it more clear. Was just pasting a real life example and hadn’t considered the confusion. Sorry.

– Strainger
yesterday





I’ve made it more clear. Was just pasting a real life example and hadn’t considered the confusion. Sorry.

– Strainger
yesterday

















draft saved

draft discarded
















































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%2f511443%2fsleep-command-using-screen-command-is-not-displayed-in-ps%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

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?