LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-04-2013, 08:44 PM   #1
coloradoruss
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
What pts is a screen associated with


I have several screens running, and I would like to be able to tell what process is running in each one. I can run ps -aux and grep pts/# to find what processes are associated with a particular pts, but I have been unable to correlate this to a screen.

What I want to do is determine what commands to send to the screen based on what is running in it, and if nothing, just kill it.

I have been reading for hours, but I can not find a way to figure out what pts a screen -dr nameHere would go to.

Any help would be appreciated. Thanks!
 
Old 11-05-2013, 01:59 AM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
supposing you are asking about displays in X11, this should do the trick in most cases:
Code:
$ cat /proc/self/environ | grep -z '^DISPLAY=' ; echo
DISPLAY=:0.0
 
Old 11-05-2013, 02:03 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,791

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
I would rather look for parent and/or child processes (of screen)
 
  


Reply

Tags
pts, screen


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using screen: Cannot open your terminal '/dev/pts/0' - please check. stefaandk Linux - General 18 06-17-2014 07:52 PM
problem with "screen" Cannot access '/newroot/dev/pts/0' - in a chroot - not /newroot stardotstar Linux - Software 0 05-01-2008 05:12 PM
pts/0... Dessan Linux - Networking 1 01-27-2006 01:17 AM
pts/0, pts/1 devices ?? nadine.mauch Linux - General 1 10-07-2004 11:00 AM
which pts do I use Luskacik Linux - Newbie 0 09-30-2004 10:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration