LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   switching pids (https://www.linuxquestions.org/questions/linux-newbie-8/switching-pids-4175416608/)

mreff555 07-13-2012 07:56 PM

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?

273 07-13-2012 08:26 PM

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.

mreff555 07-16-2012 08:01 AM

That looks like it may work.

Thanks.

psyhe 07-16-2012 03:24 PM

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.)

273 07-16-2012 03:29 PM

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


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