LinuxQuestions.org
Review your favorite Linux distribution.
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 07-13-2012, 08:56 PM   #1
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Rep: Reputation: Disabled
switching pids


is it possible to switch between pids between terminals in a shell. not jobs.

basically what I want to be able to do is this. start a shell script on the console. and log in remotely (same account) and be able to view the output while it's running. Is there a way to do this?
 
Old 07-13-2012, 09:26 PM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 5,990

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Have you looked at screen?
It allows you to start a session then "hang up" and pick up again later, and also to access the same terminal from more than one machine.
 
Old 07-16-2012, 09:01 AM   #3
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Original Poster
Rep: Reputation: Disabled
That looks like it may work.

Thanks.
 
Old 07-16-2012, 04:24 PM   #4
psyhe
LQ Newbie
 
Registered: Mar 2006
Posts: 5

Rep: Reputation: 1
You may also try tmux - it is a cleaner implementation of the same idea (terminal multiplexing), just as stable and has saner default keybindings (the main keyboard shortcut for screen is ctrl-a, which conflicts with emacs/bash ctrl-a (goto start of line), the main shorcut for tmux is ctrl-b, which is not used by emacs/bash by default).
Example:
1) run 'tmux'
2) launch your long running processing, etc.
3) press <ctrl-b-d> ### this detaches you from the tmux session (you can also just close the terminal window)
4) login again
5) in order to attach to the previous tmux session (with the long running process in it), run 'tmux att'
btw, you can attach from several *different* logins to the same session, which is usefull for sharing a session between several users (education, remote help, etc.)
 
1 members found this post helpful.
Old 07-16-2012, 04:29 PM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 5,990

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Thanks psyhe, I'll take a look at that too as it's always nice to have an alternative.
 
  


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
Parent PIDs Sinope Linux - Newbie 6 10-06-2004 12:46 AM
C++ and PIDs dbcoder Programming 1 07-15-2004 09:58 PM
killing pids i_is_cat Linux - Newbie 6 05-01-2003 12:07 PM
Samba multiple pids The Jesus Linux - Software 1 12-11-2002 11:46 AM
Multiple PIDs ? Si|entKey Linux - General 0 03-28-2001 12:03 AM


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