LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 10:05 AM   #1
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 473

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, 12: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, 12: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, 12:48 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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, 02:26 PM   #5
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 473

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, 03:56 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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, 05:19 PM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

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

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:30 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