sleep command using 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 itRunning background process with screen command in xshellscreen command not showing status barCapturing screen of “perf top” or other interactive programsRunning repetitive task through Bash scriptbash - 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 screenSearch for running script PID by script name

Where to refill my bottle in India?

Deadlock Graph and Interpretation, solution to avoid

Pristine Bit Checking

On the insanity of kings as an argument against Monarchy

Can we apply L'Hospital's rule where the derivative is not continuous?

Does a dangling wire really electrocute me if I'm standing in water?

Geography at the pixel level

Time travel alters history but people keep saying nothing's changed

Feasability of miniature nuclear reactors for humanoid cyborgs

How to create dashed lines/arrows in Illustrator

What is the best strategy for white in this position?

How was Skylab's orbit inclination chosen?

What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?

Could JWST stay at L2 "forever"?

Why Did Howard Stark Use All The Vibranium They Had On A Prototype Shield?

Where does the "burst of radiance" from Holy Weapon originate?

What is the meaning of Triage in Cybersec world?

Polarization lost upon 2nd reflection?

It's possible to achieve negative score?

Output the Arecibo Message

Lethal sonic weapons

What do hard-Brexiteers want with respect to the Irish border?

Monty Hall variation

The difference between dialogue marks



sleep command using 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 itRunning background process with screen command in xshellscreen command not showing status barCapturing screen of “perf top” or other interactive programsRunning repetitive task through Bash scriptbash - 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 screenSearch for running script PID by script name



.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
    11 hours 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
    10 hours 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
    11 hours 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
    10 hours 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 11 hours ago









fra-san

2,0271721




2,0271721










asked 11 hours 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
    11 hours 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
    10 hours 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
    11 hours 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
    10 hours 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
11 hours 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
11 hours 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
10 hours 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
10 hours ago











1 Answer
1






active

oldest

votes


















10














screen expected the command in the first argument; what you gave as that first argument was: 'sleep 2m', so it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with an argument of 2m. The screen command exited successfully, 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























    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-command-is-not-displayed-in-ps%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    10














    screen expected the command in the first argument; what you gave as that first argument was: 'sleep 2m', so it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with an argument of 2m. The screen command exited successfully, 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



























      10














      screen expected the command in the first argument; what you gave as that first argument was: 'sleep 2m', so it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with an argument of 2m. The screen command exited successfully, 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

























        10












        10








        10







        screen expected the command in the first argument; what you gave as that first argument was: 'sleep 2m', so it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with an argument of 2m. The screen command exited successfully, 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













        screen expected the command in the first argument; what you gave as that first argument was: 'sleep 2m', so it tried to execute a command named (exactly) 'sleep 2m', as opposed to what you really wanted, which was sleep with an argument of 2m. The screen command exited successfully, 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










        answered 10 hours ago









        Jeff SchallerJeff Schaller

        44.8k1164146




        44.8k1164146



























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

            Ружовы пелікан Змест Знешні выгляд | Пашырэнне | Асаблівасці біялогіі | Літаратура | НавігацыяДагледжаная версіяправерана1 зменаДагледжаная версіяправерана1 змена/ 22697590 Сістэматыкана ВіківідахВыявына Вікісховішчы174693363011049382

            ValueError: Error when checking input: expected conv2d_13_input to have shape (3, 150, 150) but got array with shape (150, 150, 3)2019 Community Moderator ElectionError when checking : expected dense_1_input to have shape (None, 5) but got array with shape (200, 1)Error 'Expected 2D array, got 1D array instead:'ValueError: Error when checking input: expected lstm_41_input to have 3 dimensions, but got array with shape (40000,100)ValueError: Error when checking target: expected dense_1 to have shape (7,) but got array with shape (1,)ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape (0,)Keras exception: ValueError: Error when checking input: expected conv2d_1_input to have shape (150, 150, 3) but got array with shape (256, 256, 3)Steps taking too long to completewhen checking input: expected dense_1_input to have shape (13328,) but got array with shape (317,)ValueError: Error when checking target: expected dense_3 to have shape (None, 1) but got array with shape (7715, 40000)Keras exception: Error when checking input: expected dense_input to have shape (2,) but got array with shape (1,)

            Illegal assignment from SObject to ContactFetching String, Id from Map - Illegal Assignment Id to Field / ObjectError: Compile Error: Illegal assignment from String to BooleanError: List has no rows for assignment to SObjectError on Test Class - System.QueryException: List has no rows for assignment to SObjectRemote action problemDML requires SObject or SObject list type error“Illegal assignment from List to List”Test Class Fail: Batch Class: System.QueryException: List has no rows for assignment to SObjectMapping to a user'List has no rows for assignment to SObject' Mystery