LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 10-09-2008, 02:22 PM   #1
tikit
Member
 
Registered: Feb 2008
Posts: 85

Rep: Reputation: 16
Automatically stdout redirection to a file


Hi,

I am wondering if there is a way how to automatically redirect stdout to a file when executing a command. Something like adding
Code:
 | tee -a outputfile.txt
after every command. I would find useful if I could see the output of a command executed in the past without executing it again if when cannot scroll the terminal window.
 
Old 10-09-2008, 03:51 PM   #2
jgallo
Member
 
Registered: Sep 2008
Posts: 39

Rep: Reputation: 15
yes you can
[code]command > file.txt[code]
and
Code:
command >> file.txt
to append the output to an existing file

Last edited by Tinkster; 10-30-2010 at 03:56 PM.
 
Old 10-10-2008, 01:40 AM   #3
tikit
Member
 
Registered: Feb 2008
Posts: 85

Original Poster
Rep: Reputation: 16
Hi,

Thanks jgallo but it is not what I need. I want everything what is displayed on the screen to be redirected to a file as well, without having to type
Code:
| tee -a outputfile.txt
after each command. Is there something like a global option, that can do that?

Thanks.
 
Old 10-10-2008, 01:53 AM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
man script
 
Old 10-10-2008, 05:18 AM   #5
tikit
Member
 
Registered: Feb 2008
Posts: 85

Original Poster
Rep: Reputation: 16
Thank you Mr. C.. That is exactly what I was looking for.
 
  


Reply



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
redirecting stdout to /dev/null and stderr to stdout? Thinking Programming 1 05-18-2006 02:36 AM
Redirecting to file and stdout Quantum0726 Programming 3 11-14-2005 08:35 PM
stdout to file Machiaveli Programming 8 09-04-2005 08:53 AM
redirection the process stdout do1do Linux - Security 3 11-23-2003 11:39 PM
redirection process stdout do1do Linux - General 2 11-23-2003 09:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 PM.

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
Open Source Consulting | Domain Registration