LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-15-2012, 11:05 AM   #1
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Rep: Reputation: Disabled
taking a peek at other processes


If I start a process on the console, and then ssh in with the same credentials is there any way I can view the process?
 
Old 12-15-2012, 01:28 PM   #2
bmarx
Member
 
Registered: Dec 2004
Distribution: Slackware, Arch, FreeBSD
Posts: 202

Rep: Reputation: 34
You question is a little vague. What information do you want from the process? If you just want things like memory usage or processor usage, you can use "ps" or "top" after you ssh back in. If you want control over the process as if you had executed it from the command line after you ssh back in, you can use something like "screen".
 
Old 12-15-2012, 01:31 PM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Which process & where you're doing ssh... please specify.
Meanwhile, a process can be identified by it's process ID i.e. PID. And you can check processes using ps command. To check processes of a user username, invoke:-
Code:
ps -aef | grep <username>
 
Old 12-15-2012, 01:48 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
If what you are asking for is a way to see what that process is writing to the console where it was started, then the answer is "no" unless the terminal emulator for that console provides some hook to let you see what is displayed. If what you want is a way to look into the internal workings of that process, then yes, you can tell gdb or strace to attach to that running process and both view and control it, but gdb in particular isn't likely to be of much use unless you've got the source code in hand and the program was compiled with debugging symbols included.
 
Old 12-15-2012, 03:26 PM   #5
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Original Poster
Rep: Reputation: Disabled
Thanks for the input.

As rknichols assumed I was searching for a way to view the process, not information about it.

I run a lot of iterative computations that take hours or days to complete. I'm looking for a way to check in on them.
 
Old 12-15-2012, 04:56 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
You might pipe the output through tee and write a copy to a file you could examine. Just watch out for output buffering. By default, output going to a terminal is line-buffered (flushed after each newline), but sending the output through a pipe would make the default block-buffered (typically 4KB blocks), so the output would be delayed until a block is filled. The program doing the computation would need a way to select how output is buffered, or you might take a look at the unbuffer utility (part of the expect package).
 
Old 12-15-2012, 06:19 PM   #7
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,159
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Quote:
...I was searching for a way to view the process, not information about it....
screen
 
Old 12-15-2012, 06:58 PM   #8
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Original Poster
Rep: Reputation: Disabled
That looks like it should work well. I'll give it a shot.
 
  


Reply


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
LXer: Peek Presents Challenge: Linux on Peek LXer Syndicated Linux News 0 07-11-2009 11:10 PM
3 machines down- please peek at my logs LarryFrigginWachs Linux - Newbie 2 04-28-2006 08:40 AM
X Server taking CPU processes pradi_net Linux - Software 5 08-20-2004 02:58 AM
Is someone trying to peek in to server ??? apache Linux - Networking 2 07-16-2004 05:44 AM
A peek into one of my IT meetings. Whitehat General 3 08-06-2003 12:00 AM


All times are GMT -5. The time now is 02:21 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration