Saving command output to bash history

Does anyone know a way to hack bash to intercept and save the output for every command it executes?

+4
source share
2 answers

you can use the GNU screen utility ( http://www.gnu.org/software/screen/ ) with the -L switch

+1
source

I thought about this, and in the simplest form you have the following:

 $ cat clone #! /bin/bash bash -i |tee >(cat >>/tmp/bash.log.$$) # $ vim clone # Vim: Warning: Output is not to a terminal $ ./clone $ du -sb /tmp/bash.log.9609 29 /tmp/bash.log.9609 109 /tmp/bash.log.9609 161 /tmp/bash.log.9609 213 /tmp/bash.log.9609 
0
source

All Articles