Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Is the terminals output (i.e. not commands) history hiding somewhere that lets me do something like..

grep "foo foo \d{5}" ~/.terminal

I'm aware I can simply pipe stuff to grep, or save it to a file rather than putting it in the terminal. It's just that sometimes I've had a program output some stuff I'd like to search through but would rather not rerun it just for greps benefit. :)

share|improve this question
up vote 4 down vote accepted

The output is not stored in any files, no. But you can use the script command to record a terminal session. Just run


Then run your commands as usual. When you type exit, you will exit the script program. All input and output can then be found in a file named typescript in your current directory. You can use less -R typescript to read and search through it.

As usual, it's a good idea to read the manual before using a new command. man script

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.