Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I started a process on my Linux machine through Putty by running a jar. Now the program will take at least 24 hours to run, and my Putty terminal session has been interrupted. I have added code in the program to output information to track the progress of the job via System.out.println. If I know the PID of the process, is there any way to open a new terminal session in Putty and view the output the process is currently outputting, as if I were in the same session from which I executed the JAR?


share|improve this question

migrated from Aug 27 '12 at 1:00

This question came from our site for professional and enthusiast programmers.

For future reference, I would just redirect the output to a text file for something like this. – squiguy Aug 26 '12 at 0:56
strace -p PID would be a crude way to find out what it's currently printing. For future reference... run screen when you log in via ssh, then if you get disconnected you can log in and run screen -r to pick up where you left off. – Alan Curry Aug 26 '12 at 1:05

1 Answer 1

You can attach your process to a new terminal like this:

git clone
cd reptyr/

And grep for you JAR PID:

ps -ef | grep "YOUR_JAR"

Then :

./reptyr YOUR_JAR_PID

And you'll see that the current session will be attached to your JAR.

More on this great tool :

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.