Capture all stdin of shell to a file.
Hi Linuxers
I am trying to make a script which will enable me to capture all the commands I type on my prompt to be saved into a file. I know it is possible just that I cannot find link to it on the net and I dont know how to do it. Any help will be really appreciated. Thanks |
Why do you need that?
See the man pages of your shell, especially the 'history' command. |
I need to save all the day's work and see whats happenning
I am working on a new product and I shall be running a lot of commands. So I just want to save it to a particular file. Thats it. I know it can happen. Its not about shell pages. Its just a small script.
Anyways thanks for the concern. |
You could use the "script" command for creating a typescript of your terminal session, but it probably also saves the output of your commands. So, you may want to add output redirection to your commands if you don't want to get your output in the typescript file.
|
Yes I know about the script command but I dont want the output also to be re-directed. I just want that whatever goes to stdin should be copied to the file.
Anyways thanks. |
The following works with Bash (to some extent at least):
Code:
exec 0< <( tee -a logfile ) |
All times are GMT -5. The time now is 05:36 PM. |