Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Everyday I connect to a remote machine (RedHat) from my macbook (Lion). I use Terminal to connect to remote machine and then to chroot. Then I open 2-3 windows on Terminal for various files.

Is there any shortcut to preserve the windows with open files and connection?

I tried "Save Windows as Group" on Macbook terminal but it does not work.


I want to see all open files visible in various terminal instead of it going into background!

share|improve this question

Yes, you want to use a terminal multiplexer such as screen or tmux on the remote RedHat host.

You can launch multiple virtual terminals inside a screen or tmux session. when you detach from the session, your virtual terminals continue to persist. This enables you to continue to run jobs that you want to monitor, continue editing files, keep a man page open. You can later reattach to the session and continue to work.

There is a lot of good documentation about both programs (and opinion about which is better). These tmux and screen wikis are specific to ArchLinux, but are good starting points.

share|improve this answer
Ok, I will give it a try. Earlier I tried to use screen from the connecting server that did not work correctly. and Open files used to go into background. I want to see all open files visible. – Satya Prakash May 5 '12 at 10:03
Will all open files will be visited at the same time or only one will be visible and other will be open in Background! – Satya Prakash May 5 '12 at 10:04

It sounds like you are asking for several things: 1) You want to reopen Terminal windows in the same position on your screen 2) You want the Terminal windows to connect to specified servers 3) You want an uninterrupted connection to the server: so you can pick up where you left off.

I'm at a Windows machine right now, but I believe only does #1. You can achieve #1 and #2 through AppleScript (or appscript) scripts: search and ye shall find. But #3 would require the use of either screen or tmux (or possibly dtach, but I've never used that). screen is more widely available, but I would recommend tmux slightly above screen. They work very similarly, though, so either should more than meet your needs.

You'd run screen (or tmux) on the server that you connect to, and detach from your screen session when you're done for the day. screen would still be running on the server, keeping your shell session alive, and preserving its state for the next time you log in. The next day you'd log in and reattach to the screen session, and be good to go.

share|improve this answer
If #1 is about the position of Terminal window on screen then that is not a big issue. I want #2 and #3. I tried screen earlier but I think I have not used it correctly. I started screen from MacBook terminal. But you said to use screen on the connecting server. Then I saw each open files goes into background there which I don't like. I want to see 2-3 file open at a time. – Satya Prakash May 5 '12 at 9:59
I may give a screen and tmux a try again. If you have simple usage document for my case then please point me to there. Thanks! – Satya Prakash May 5 '12 at 10:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .