Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy all typed command in a linux console & their result to a file

Tags:

linux

bash

I'm trying to make a script to automatically install programs and configure them on my Fedora 19 linux distribution. To create it, I made a VM and I'm typing all the command manually in my "Terminal" application.

I'd like to be able to log all what I've typed and all the output (stdin & stderr & stdout if I understood it well) so I can use this log to make my script.

Is there a way to do this ?

like image 834
IggY Avatar asked Jul 31 '13 05:07

IggY


1 Answers

You can use the script command to record your session:

$ script session.txt
Script started, file is session.txt
$ ls
session.txt
$ exit
Script done, file is session.txt

$ cat session.txt
Script started on Wed 31 Jul 2013 07:36:40 AM CEST
$ ls
session.txt
$ exit
Script done on Wed 31 Jul 2013 07:36:42 AM CEST
like image 93
Andreas Fester Avatar answered Oct 19 '22 20:10

Andreas Fester