list processes running inside of screen (manager with with VT100/ANSI terminal emulation)
I have an application that during installation runs a bunch of processes via screen, so I can see those if attached to the screen, however I don't see those via "ps -ef" or "ps auxww". How can I list all the processes running inside of screen ?
Thanks.
process gnu-screen
add a comment |
I have an application that during installation runs a bunch of processes via screen, so I can see those if attached to the screen, however I don't see those via "ps -ef" or "ps auxww". How can I list all the processes running inside of screen ?
Thanks.
process gnu-screen
add a comment |
I have an application that during installation runs a bunch of processes via screen, so I can see those if attached to the screen, however I don't see those via "ps -ef" or "ps auxww". How can I list all the processes running inside of screen ?
Thanks.
process gnu-screen
I have an application that during installation runs a bunch of processes via screen, so I can see those if attached to the screen, however I don't see those via "ps -ef" or "ps auxww". How can I list all the processes running inside of screen ?
Thanks.
process gnu-screen
process gnu-screen
asked Dec 9 '14 at 17:08
Mark
4732624
4732624
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
start cmd: # screen -ls
There is a screen on:
24525.pts-0.syscontrol (Attached)
start cmd: # pstree -p 24525
screen(24525)─┬─bash(10773)───su(10790)───bash(10791)
├─bash(10863)───pstree(11099)
└─bash(24526)
add a comment |
Using pstree greatly simplifies the problem, but some clarification might help.
When you start screen, it runs two processes, screen (the parent) and SCREEN (the child):
- The
-lsoption ofscreenshows the session identifier with the child's process-id. - You should list the parent process-id for consistency.
- It helps to show the argument list;
pstreecan do this. - You could have multiple screen sessions on the same machine.
Tying these together calls for a script. Here is an example:
# $Id: ps-screen,v 1.1 2016/10/23 22:19:56 tom Exp $
# http://unix.stackexchange.com/questions/172347/list-processes-running-inside-of-screen-manager-with-with-vt100-ansi-terminal-e
screen -ls | awk '/[0-9]+./{print;}' | while read session
do
child=$(echo "$session" | awk '{sub("..*","",$1); print $1;}')
printf '%sn' "$session"
parent=$(ps -p $child -o ppid=)
pstree -p -a $parent
done
and example output, for two sessions:
~ (101) ps-screen
38142.pts-1.vmw-debian7-64 (10/23/2016 06:20:28 PM) (Attached)
screen,38141
└─screen,38142
└─tcsh,38143
└─ps-screen,38161 /users/tom/bin/ps-screen
└─ps-screen,38164 /users/tom/bin/ps-screen
└─pstree,38169 -p -a 38141
3975.pts-0.vmw-debian7-64 (10/23/2016 06:15:28 AM) (Attached)
screen,3974
└─screen,3975
├─tcsh,5002
│ └─ded,19926 /usr/build//ncurses
│ └─vile,24647 /usr/build/ncurses/ncurses-6.0-20161029/NEWS
└─tcsh,36551
└─ded,36569 /tmp
Further reading:
pstree - display a tree of processes (Linux)
pstree - display a tree of processes (FreeBSD)
add a comment |
Retrieve tty(pty) from screen -ls and then, ps -t ttyname or ps t ttyname will display process list associated with ttyname.
ps(1) manpage on Ubuntu
screen(1) manpage on Ubuntu
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f172347%2flist-processes-running-inside-of-screen-manager-with-with-vt100-ansi-terminal-e%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
start cmd: # screen -ls
There is a screen on:
24525.pts-0.syscontrol (Attached)
start cmd: # pstree -p 24525
screen(24525)─┬─bash(10773)───su(10790)───bash(10791)
├─bash(10863)───pstree(11099)
└─bash(24526)
add a comment |
start cmd: # screen -ls
There is a screen on:
24525.pts-0.syscontrol (Attached)
start cmd: # pstree -p 24525
screen(24525)─┬─bash(10773)───su(10790)───bash(10791)
├─bash(10863)───pstree(11099)
└─bash(24526)
add a comment |
start cmd: # screen -ls
There is a screen on:
24525.pts-0.syscontrol (Attached)
start cmd: # pstree -p 24525
screen(24525)─┬─bash(10773)───su(10790)───bash(10791)
├─bash(10863)───pstree(11099)
└─bash(24526)
start cmd: # screen -ls
There is a screen on:
24525.pts-0.syscontrol (Attached)
start cmd: # pstree -p 24525
screen(24525)─┬─bash(10773)───su(10790)───bash(10791)
├─bash(10863)───pstree(11099)
└─bash(24526)
answered Dec 9 '14 at 18:27
Hauke Laging
55.6k1285133
55.6k1285133
add a comment |
add a comment |
Using pstree greatly simplifies the problem, but some clarification might help.
When you start screen, it runs two processes, screen (the parent) and SCREEN (the child):
- The
-lsoption ofscreenshows the session identifier with the child's process-id. - You should list the parent process-id for consistency.
- It helps to show the argument list;
pstreecan do this. - You could have multiple screen sessions on the same machine.
Tying these together calls for a script. Here is an example:
# $Id: ps-screen,v 1.1 2016/10/23 22:19:56 tom Exp $
# http://unix.stackexchange.com/questions/172347/list-processes-running-inside-of-screen-manager-with-with-vt100-ansi-terminal-e
screen -ls | awk '/[0-9]+./{print;}' | while read session
do
child=$(echo "$session" | awk '{sub("..*","",$1); print $1;}')
printf '%sn' "$session"
parent=$(ps -p $child -o ppid=)
pstree -p -a $parent
done
and example output, for two sessions:
~ (101) ps-screen
38142.pts-1.vmw-debian7-64 (10/23/2016 06:20:28 PM) (Attached)
screen,38141
└─screen,38142
└─tcsh,38143
└─ps-screen,38161 /users/tom/bin/ps-screen
└─ps-screen,38164 /users/tom/bin/ps-screen
└─pstree,38169 -p -a 38141
3975.pts-0.vmw-debian7-64 (10/23/2016 06:15:28 AM) (Attached)
screen,3974
└─screen,3975
├─tcsh,5002
│ └─ded,19926 /usr/build//ncurses
│ └─vile,24647 /usr/build/ncurses/ncurses-6.0-20161029/NEWS
└─tcsh,36551
└─ded,36569 /tmp
Further reading:
pstree - display a tree of processes (Linux)
pstree - display a tree of processes (FreeBSD)
add a comment |
Using pstree greatly simplifies the problem, but some clarification might help.
When you start screen, it runs two processes, screen (the parent) and SCREEN (the child):
- The
-lsoption ofscreenshows the session identifier with the child's process-id. - You should list the parent process-id for consistency.
- It helps to show the argument list;
pstreecan do this. - You could have multiple screen sessions on the same machine.
Tying these together calls for a script. Here is an example:
# $Id: ps-screen,v 1.1 2016/10/23 22:19:56 tom Exp $
# http://unix.stackexchange.com/questions/172347/list-processes-running-inside-of-screen-manager-with-with-vt100-ansi-terminal-e
screen -ls | awk '/[0-9]+./{print;}' | while read session
do
child=$(echo "$session" | awk '{sub("..*","",$1); print $1;}')
printf '%sn' "$session"
parent=$(ps -p $child -o ppid=)
pstree -p -a $parent
done
and example output, for two sessions:
~ (101) ps-screen
38142.pts-1.vmw-debian7-64 (10/23/2016 06:20:28 PM) (Attached)
screen,38141
└─screen,38142
└─tcsh,38143
└─ps-screen,38161 /users/tom/bin/ps-screen
└─ps-screen,38164 /users/tom/bin/ps-screen
└─pstree,38169 -p -a 38141
3975.pts-0.vmw-debian7-64 (10/23/2016 06:15:28 AM) (Attached)
screen,3974
└─screen,3975
├─tcsh,5002
│ └─ded,19926 /usr/build//ncurses
│ └─vile,24647 /usr/build/ncurses/ncurses-6.0-20161029/NEWS
└─tcsh,36551
└─ded,36569 /tmp
Further reading:
pstree - display a tree of processes (Linux)
pstree - display a tree of processes (FreeBSD)
add a comment |
Using pstree greatly simplifies the problem, but some clarification might help.
When you start screen, it runs two processes, screen (the parent) and SCREEN (the child):
- The
-lsoption ofscreenshows the session identifier with the child's process-id. - You should list the parent process-id for consistency.
- It helps to show the argument list;
pstreecan do this. - You could have multiple screen sessions on the same machine.
Tying these together calls for a script. Here is an example:
# $Id: ps-screen,v 1.1 2016/10/23 22:19:56 tom Exp $
# http://unix.stackexchange.com/questions/172347/list-processes-running-inside-of-screen-manager-with-with-vt100-ansi-terminal-e
screen -ls | awk '/[0-9]+./{print;}' | while read session
do
child=$(echo "$session" | awk '{sub("..*","",$1); print $1;}')
printf '%sn' "$session"
parent=$(ps -p $child -o ppid=)
pstree -p -a $parent
done
and example output, for two sessions:
~ (101) ps-screen
38142.pts-1.vmw-debian7-64 (10/23/2016 06:20:28 PM) (Attached)
screen,38141
└─screen,38142
└─tcsh,38143
└─ps-screen,38161 /users/tom/bin/ps-screen
└─ps-screen,38164 /users/tom/bin/ps-screen
└─pstree,38169 -p -a 38141
3975.pts-0.vmw-debian7-64 (10/23/2016 06:15:28 AM) (Attached)
screen,3974
└─screen,3975
├─tcsh,5002
│ └─ded,19926 /usr/build//ncurses
│ └─vile,24647 /usr/build/ncurses/ncurses-6.0-20161029/NEWS
└─tcsh,36551
└─ded,36569 /tmp
Further reading:
pstree - display a tree of processes (Linux)
pstree - display a tree of processes (FreeBSD)
Using pstree greatly simplifies the problem, but some clarification might help.
When you start screen, it runs two processes, screen (the parent) and SCREEN (the child):
- The
-lsoption ofscreenshows the session identifier with the child's process-id. - You should list the parent process-id for consistency.
- It helps to show the argument list;
pstreecan do this. - You could have multiple screen sessions on the same machine.
Tying these together calls for a script. Here is an example:
# $Id: ps-screen,v 1.1 2016/10/23 22:19:56 tom Exp $
# http://unix.stackexchange.com/questions/172347/list-processes-running-inside-of-screen-manager-with-with-vt100-ansi-terminal-e
screen -ls | awk '/[0-9]+./{print;}' | while read session
do
child=$(echo "$session" | awk '{sub("..*","",$1); print $1;}')
printf '%sn' "$session"
parent=$(ps -p $child -o ppid=)
pstree -p -a $parent
done
and example output, for two sessions:
~ (101) ps-screen
38142.pts-1.vmw-debian7-64 (10/23/2016 06:20:28 PM) (Attached)
screen,38141
└─screen,38142
└─tcsh,38143
└─ps-screen,38161 /users/tom/bin/ps-screen
└─ps-screen,38164 /users/tom/bin/ps-screen
└─pstree,38169 -p -a 38141
3975.pts-0.vmw-debian7-64 (10/23/2016 06:15:28 AM) (Attached)
screen,3974
└─screen,3975
├─tcsh,5002
│ └─ded,19926 /usr/build//ncurses
│ └─vile,24647 /usr/build/ncurses/ncurses-6.0-20161029/NEWS
└─tcsh,36551
└─ded,36569 /tmp
Further reading:
pstree - display a tree of processes (Linux)
pstree - display a tree of processes (FreeBSD)
answered Oct 23 '16 at 22:25
Thomas Dickey
52k594164
52k594164
add a comment |
add a comment |
Retrieve tty(pty) from screen -ls and then, ps -t ttyname or ps t ttyname will display process list associated with ttyname.
ps(1) manpage on Ubuntu
screen(1) manpage on Ubuntu
add a comment |
Retrieve tty(pty) from screen -ls and then, ps -t ttyname or ps t ttyname will display process list associated with ttyname.
ps(1) manpage on Ubuntu
screen(1) manpage on Ubuntu
add a comment |
Retrieve tty(pty) from screen -ls and then, ps -t ttyname or ps t ttyname will display process list associated with ttyname.
ps(1) manpage on Ubuntu
screen(1) manpage on Ubuntu
Retrieve tty(pty) from screen -ls and then, ps -t ttyname or ps t ttyname will display process list associated with ttyname.
ps(1) manpage on Ubuntu
screen(1) manpage on Ubuntu
answered Nov 7 at 2:43
minish
21615
21615
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f172347%2flist-processes-running-inside-of-screen-manager-with-with-vt100-ansi-terminal-e%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown