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
What is the purpose of trimming the bottom corners of TLC plates?
Where to refill my bottle in India?
Why is it "Tumoren" and not "Tumore"?
Does a dangling wire really electrocute me if I'm standing in water?
Geography at the pixel level
How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?
Why is the design of haulage companies so “special”?
description of papers that have not been submitted to a venue?
The difference between dialogue marks
How can I create a character who can assume the widest possible range of creature sizes?
It's possible to achieve negative score?
sleep command using command is not displayed in ps
Unbreakable Formation vs. Cry of the Carnarium
What are the advantages and disadvantages of running one shots compared to campaigns?
Access elements in std::string where positon of string is greater than its size
Can one use the reaction spell from the War Caster feat to cast Bigby's Hand?
Python comments not highlighted with lstlisting
Are there any other methods to apply to solving simultaneous equations?
What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?
How to manage monthly salary
Can I write a for loop that iterates over both collections and arrays?
Is "plugging out" electronic devices an American expression?
JSON.serialize: is it possible to suppress null values of a map?
In What Way Would Cryomancy Affect the Food Eaten by Medieval People?
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;
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
add a comment |
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
why would you want to runsleep
through a detachedscreen
? couldn’t you just run it assleep 2m &
directly from your shell ? besides,ps
alone shows only processes belonging to your terminal window, while whatever you run throughscreen
will belong to a different virtual terminal
– LL3
3 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 usingps -a | grep sleep
still it is not showing any new process running sleep.
– Rajkumar Natarajan
2 hours ago
add a comment |
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
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
scripting gnu-screen ps
edited 3 hours ago
fra-san
2,0271721
2,0271721
asked 3 hours ago
Rajkumar NatarajanRajkumar Natarajan
1347
1347
why would you want to runsleep
through a detachedscreen
? couldn’t you just run it assleep 2m &
directly from your shell ? besides,ps
alone shows only processes belonging to your terminal window, while whatever you run throughscreen
will belong to a different virtual terminal
– LL3
3 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 usingps -a | grep sleep
still it is not showing any new process running sleep.
– Rajkumar Natarajan
2 hours ago
add a comment |
why would you want to runsleep
through a detachedscreen
? couldn’t you just run it assleep 2m &
directly from your shell ? besides,ps
alone shows only processes belonging to your terminal window, while whatever you run throughscreen
will belong to a different virtual terminal
– LL3
3 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 usingps -a | grep sleep
still it is not showing any new process running sleep.
– Rajkumar Natarajan
2 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
3 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
3 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
2 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
2 hours ago
add a comment |
1 Answer
1
active
oldest
votes
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
# ...
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%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
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
# ...
add a comment |
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
# ...
add a comment |
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
# ...
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
# ...
answered 2 hours ago
Jeff Schaller♦Jeff Schaller
44.8k1163145
44.8k1163145
add a comment |
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%2f511443%2fsleep-command-using-command-is-not-displayed-in-ps%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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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
why would you want to run
sleep
through a detachedscreen
? couldn’t you just run it assleep 2m &
directly from your shell ? besides,ps
alone shows only processes belonging to your terminal window, while whatever you run throughscreen
will belong to a different virtual terminal– LL3
3 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
2 hours ago