Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running a perl script in the background that prints some progress information to the stdout ie terminal.
(cmdline: nohup perl script.pl &)
As this script takes some time to run (~3days) I will have to logout. This loses the output to the terminal.
Is there anyway to regain the output when i log back in?
I know i could pipe the output to a file, but I don't really want to do that.
Originally posted by Azmeen type jobs to see the list of background processes...
and type fg job number to bring it to the foreground.
The job number is in square braces.
Edit: Barghh... replied too fast, anyway, eventhough you mentioned that you prefer not to pipe the output into a file, but IMHO, that's the only way to do it. You could just grep the important bits of the output if you know the pattern, that might improve the signal to noise ratio of your output log.
I realize this thread hasn't been touched in a long time, but it's still at the top of Google's results, so I thought I'd contribute an answer.
screen would be great. Start up the command in a screen session, detatch, and then reattach later. To see output that has scrolled past the top of the screen, go into copy mode with C-a [ (and get out with escape).
If you Google "I'm Feeling Lucky" for 'the beauty of screen' you can follow scenario 1.
I agree that 'screen' is the literal answer to the OP qn, but (personally) I would always log to a file just in case the process dies, gets killed, system reboots etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.