I just now executed a perl command and printed the output on the terminal. Trying to cut/paste the output, I accidentally clicked "close" in the left icon bar instead of "Edit". Does that mean the printed information is forever lost, or is there a specific directory in my computer I can use to recover the output. This was also the most recent commands I executed so if there was a log that automatically redirected output as history, is there a way I can view that log? Thanks for helping.
Asked
Active
Viewed 60 times
1 Answers
3
If you are using Linux, all text print to screen in the terminal will be lost when the connection to shell closed.
To avoid this, two suggestions:
- use tmux, which is a tool keeps your connection as a services, so next time when you connect to tmux service, everything restores (unless your computer is rebooted). And it is a powerful tool to provide you high effecience under terminal.
- use
nohup
command, like:nohup your_script &
to keep everything running in background even connection to shell is closed.

d4l
- 66
- 1
- 3
-
I was using Windows, so what does that mean the same thing? – J. Linne Sep 12 '16 at 01:33
-
1@J.Linne I'm not familiar with Windows, but seems you can use `start` alternative to `nohup` according to [nohup - How to run a task in background in windows - Super User](http://superuser.com/questions/1021953/how-to-run-a-task-in-background-in-windows) and [What's the nohup on Windows? - Stack Overflow](http://stackoverflow.com/questions/3382082/whats-the-nohup-on-windows) – d4l Sep 12 '16 at 01:50