From Mac OSX I login to a remote server that handles parallel computing jobs. I am not able to install anything on this server as it is administered by the university. I have multiple jobs running and want to monitor the log file in the following way:

tail -f logfile.log

Right now I have four jobs running, I open four terminal windows, SSH four times into the server, and do the tail command four times for the different logfiles (which are in different folders on the server). I have the feeling that I'm doing this in a sub-optimal way and am looking to just SSH once, then from one terminal window open all the four log files in separate windows (or tabs) with the tail command.

Is this possible? Or is it mandatory to sign in four times?

  • I updated my answer under the assumption that you might want to actually have multiple osx windows instead of a terminal multiplexer. Is that a correct assumption? – dtmland Jul 16 '13 at 20:33
  • Your original answer did what I wanted. The only problem now is that I can't split vertically as the screen command is not patched (and I can't patch without the proper rights), but that's a minor nuisance. – Saaru Lindestøkke Jul 16 '13 at 20:35
  • It's worth noting that both screen and tmux allow you to run a command automatically on each new window. So if you use SSH login with a public key, you can open an arbitrary number of SSH sessions, to one or more servers, with just one command, and already split as you wish (I did this often with tmux, never tried with screen). – Paulo Almeida Jul 16 '13 at 20:44

The screen utility will allow to have multiple windows in a session. (You will have to install it on the server end)

This guy shows you the commands for how to split your views within the same terminal window.

It's also useful for re-connecting to a dropped session.


Note that screen and tmux sessions will all "live" within one session which will still only give you one window or tab on OSX terminal app itself (even though these utilities allow you to have multiple "windows/views" within that view). See comments from this user:

ssh connections are a single process running in one shell, and when you create a new tab you are creating a new local shell that will not be running this process. Furthermore the remote server will not accept a duplicate connection from you without authentication. In essence, this is impossible to do. The closest thing you can do is make use of the bash history, and press the up arrow to scroll through your most recent commands until you get to the ssh command you used for your current connection, and then execute it.

If you still desire to have multiple windows/tabs in the OSX terminal app itself you will need to "login" multiple times. Several users have created scripts to try to aid this process.

This users solution might work best for you. This user creates a menu for his remote connections.

Other solutions I've seen only work with local sessions, but the idea is similar.


tmux is a newer option similar to screen. It may be easier to find for newer operating systems than screen. You can find the documentation here


My personal favorite tool for this is Byobu. It sits on top of tmux or screen, and has nice addons built into it on those programs to make easier to see how many terminals you have open. Really, it just makes those programs easier to use.


Poderosa - a tabbed terminal emulator for Windows.


Screenshot: http://www.ziggi.com.br/imagens_programas/screenshots/big_1262696847_32495.jpg

  • 2
    Is this your own project or are you related to it? Full disclosure in answers is a good habit. Downvote because: From Mac OSX I login to a remote server... – Saaru Lindestøkke Feb 6 '14 at 12:02
  • OSX - sorry, I didn't notice it. – MrCricket Feb 6 '14 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.