I run a script: python my_script.py. It outputs a bunch of lines in the terminal. I forgot to use the output command: python my_script.py > file.txt. Is it possible to get the recent output to the screen into a file, other than with copy-paste?
Asked
Active
Viewed 59 times
0
DevShark
- 103
- 3
-
1Writing this question is probably more work then copy-paste :) – Jacob Vlijm Apr 06 '16 at 12:34
-
1If you knew you would forget to use `>` *before* you even started ( :) ), you could use the `script` command of course. http://askubuntu.com/questions/161935/how-do-i-log-all-input-and-output-in-a-terminal-session – Jacob Vlijm Apr 06 '16 at 12:50
1 Answers
0
Bash only keeps a history of the commands you entered. You can retrieve it by entering history Bash never stores the output of these commands , so the copy/paste option is the only hope for you.
storm
- 4,943
- 6
- 35
- 48