LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2011, 04:47 AM   #1
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Rep: Reputation: 1
howto record operations in log file from terminal


Hi

I would like to document my activity on linux terminal during some operation.
I want to have text file which will contain all commands I typed and output from those commands in a file.

I know how to set this option in Putty but I have some problems in linux terminal.
<pre>
bash | tee output.log
</pre>
When I perform above spell, it only records STDOUT to file. I don't have there STDIN,STDERR.

How to have in this output.log file STDIN,STDOUT,STDERR ?

thx for help.
 
Old 07-27-2011, 04:52 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

I use screen when I have to log sessions. First start screen, then CTRL A and next H to start logging. Everything you type from then will be logged in a file which you can revise later.

Kind regards,

Eric
 
Old 07-27-2011, 04:55 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

If you want to record everything that is done, you might want to have a look at the script command.

Quote from the man page:
Quote:
Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1).
If you do want to keep using tee: bash 2>&1 | tee output.log should work.

Hope this helps.
 
1 members found this post helpful.
Old 07-27-2011, 06:47 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

Thanks druuna, learned something new today, didn't know the script command.

Kind regards,

Eric
 
Old 07-27-2011, 08:05 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
See also rootsh http://linux.die.net/man/1/rootsh
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
edited the wheel group file and i cant log in as root again in the terminal cheezy86 Linux - Newbie 6 05-16-2009 08:37 PM
samba howto log every file modification? j0hnd0e Linux - Networking 0 12-06-2007 06:03 AM
HOWTO Log File Transfers Sizes with IMAP pjcp64 Linux - Software 0 06-28-2005 01:29 PM
How to direct output both log file and to terminal... freebies Linux - General 1 02-25-2005 07:32 AM
operations of gnome-terminal chrismiceli Linux - Software 1 12-04-2002 11:10 PM


All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration