Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to see if there is some smooth way (that is, not me just writing a wrapper for the shell) to get full logs of both everything I enter into the command-line shell and everything that gets output. Often I tinker a lot with various softwares, and this seems like it'd be a nice way to trace my steps back.

I use zsh, but I'm welcome to solutions even if they happen to be bash (or some other shell) specific.


share|improve this question
if its just input, the 'history' command is great – Journeyman Geek Mar 17 '13 at 5:34

You might be looking for ttyrec which records the input and output of the entire console session, and allows you to play it back.

share|improve this answer

Look into sudosh. A link to the SourceForge page is: HERE

(There may even be a package, depending on your repos/disto)

You can "sudosh" into a shell and everything is recorded for that session. All sudosh sessions are recorded and saved with a date and time stamp appended to it automatically.

(You can even grep/search the contents of the sudosh recording)

You can then use sudosh-replay to play back a recording of the shell session, just like you were watching it happen in real time.

share|improve this answer

You could use screen (or tmux) and enable logging.

screen -L
share|improve this answer

script does what you want.

Script makes a typescript of everything printed on your terminal.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .