How to prevent clearing of terminal output when I "exit" an SSH session?

This is the situation: I open a terminal in Ubuntu, and do ssh host-1, which works as expected. From host-1, I do ssh host-2, which again works fine and connects me to host-2. From host-2 I do, for example, echo "blah", which prints blah to the screen. Problem: If I do exit, the screen is cleared, and I am left with only the following:

Connection to host-2 closed.

How can I prevent the clearing of output from the screen generated by commands run on host-2 (i.e. blah, etc.), after I exit back to host-1?

Some debugging I've already done: I've had a friend login to host-1 and host-2, exactly as above, and when he exit's from host-2, his screen is NOT cleared. So it must be something to do with my environment...right? Any ideas what it could be?

I've tried this using PuTTY in Windows XP, and from a terminal in Ubuntu - same behaviour regardless.

Thanks in advance! Roy


Check ~/.bash_logout

It probably contains "clear" command. Comment that out.

Also, in a lot of terminals, (e.g. gnometerm) you can just scroll back up and see what was "cleared".

Category: bash Time: 2009-03-13 Views: 0
Tags: bash ssh

Related post

  • MPlayer halts when I exit the SSH session in Linux 2014-11-07

    I want to launch MPlayer via SSH and let it run (I'm a radio fan). For this I SSH to my remote machine (a Cubietruck running LUbuntu) and I issue the following command: screen mplayer -playlist .path/to/the/playlist Everything works as expected, but

  • How to prevent IPv6 privacy extensions from breaking my long-lived SSH sessions? 2011-12-18

    When using SSH from my Windows 7 desktop to Linux servers, via IPv6, I'm having the following two problems, because of IPv6 Privacy Extensions: I'm used to keep ssh sessions open for days or weeks. Now, when using IPv6, they are disconnected after se

  • How to prevent Gmail from logging in when I am in private session? 2009-08-28

    I use Firefox in the private mode because I use a public computer. This I thought would eliminate all cookies, history and passwords between sessions. But I am finding, time and again, that Gmail does not ask me for my password when I restart my brow

  • preventing the screen from being cleared when exiting an ssh session 2013-04-02

    I have rdist set up to push out some of my dot files to all the remote machines that I need to ssh into. I also have zsh as my default shell on all of those machines. When I ssh into a machine and then exit, the screen is cleared. I find this behavio

  • How do I clear the terminal History? 2015-05-13

    I am using Linux Mint 17.1 Rebecca for about 2 days and accidentally typed my password into the terminal which is now displayed in the history list of commands I have previously typed. I want to clear the terminal history completely. I have tried usi

  • How to open a new terminal window when using VIM 2011-04-27

    does someone know how to open a new terminal window when opening a new text with VIM. I would like to have an autarchic window which can be resized and closed while the other windows will stay as and where they are. Regards mmm... --------------Solut

  • How do you copy a local file while logged into a SSH session within Linux (ubuntu)? 2013-04-05

    how can i transfer a local file to a logged in ssh session without using scp? im doint this in the terminal under ubuntu, but this goes for any linux system. ** say im logged into a server via the terminal in ubuntu and now i want to copy one of my f

  • How to really clear the terminal? 2011-02-06

    I can issue the clear command or press Ctrl + L to clear the current Ubuntu terminal, but this just shifts previous output upwards and if you use mouse scroll or PgUP and PgDown keys it's hard to distinguish where the output of previous command ends

  • How to prevent a program from dying when its ssh session dies? 2011-05-23

    I have a really old console application that I want to make a bit more resilient. The program is used this way: the user uses a custom terminal emulator to connect to a remote machine through ssh the user starts a shell script the shell script might

  • How to prevent GhostScript from substituting fonts when compressing a PDF file? 2012-09-06

    I have a PDF file that I want to compress as small as possible. Unfortunately GhostScript substituted some fonts for the existing fonts in the original PDF. I used the following command when invoking GhostScript: gswin64c -dCompatibilityLevel=1.5 -dA

  • How to prevent Excel from inserting formulas when typing + or - at the beginning of a cell? 2015-01-20

    Sometimes I have to mark some cells in a spreadsheet with - to indicate that it was not available or not related, not tested... Sometimes I also use + to denote positiveness or availability. But after pressing +/- key in an empty cell and press arrow

  • How to prevent a dialog from closing when a button is clicked 2010-04-12

    I have a dialog with EditText for input. When I click yes button on dialog, it will validate the input and then close the dialog. However, if the input is wrong, I want to remain in the same dialog. Every time no matter what the input is, the dialog

  • How can I set the terminal encoding when running a crontab job? 2014-06-22

    I have a crontab job which executes a Ruby script on Arch Linux. It works basically, but when I call "googlecl" to post to my blog, it always shows a "safeDecodeError" exception (eg.: googlecl.SafeDecodeError: ascii could not decode 'V

  • How to prevent screen from terminating once process ends 2014-09-28

    I'm launching a process in a named screen like: screen -dmS myscreen bash -c "export VAR=123; cd /usr/local/myproject; ./" However, after a few minutes, my script crashes and when it exits the screen terminates so I can't see the debu

  • How to prevent zsh from expanding history when space bar is pressed? 2015-06-10

    I would like to use the expansion mv 'foo bar' !#:1:s^\ ^-^ to produce the command mv 'foo bar' 'foo-bar'. However when I press the space bar, zsh assumes I've finished typing the expansion, leaving me with mv 'foo bar' !#:1:s^\ which yields mv 'foo

  • How to prevent Chrome from terminating on closing of the last opened tab? 2015-12-16

    How can I prevent Chrome from terminating on closing the last opened tab? Instead of terminating, I want Chrome to always display a blank open tab. --------------Solutions------------- On OS X , enable 'Warn Before Quitting' -

  • How to prevent an animation from completing when user leaves and returns to app 2016-01-16

    I am making an app where I have a button who is moving from one side of the screen to the other. I have created a pause button which pauses the animation once that button is selected. This button and function works fine. I also added a function which

  • changing the first welcome output when logging in via ssh 2009-11-04

    I was just wondering on CentOs how can I change the 'greeting' that the server output when a user logs in via ssh? --------------Solutions------------- Perhaps you are looking to update the content that is part of the Message of the Day (MOTD). I bel

  • how to automatically mount ~/Private using ecryptfs when logging in via ssh pubkey 2011-02-02

    Raionale: I want to be able to automatically make backups to a remote machine, which will be encrypted with ecryptfs. The title says it all: I set up ecryptfs-utils on my Debian Squeeze box, and set up one user to use it via ecryptfs-setup-private. W

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 2.262 (s). 13 q(s)