Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 3 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

script

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

 
discard

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.