LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-01-2009, 03:57 AM   #1
ahmedb72
Member
 
Registered: Jan 2006
Location: Sydney
Distribution: RHEL
Posts: 72

Rep: Reputation: 15
Redirecting to Files and STDIN


Hi,
tee command can be used to read from standard input and write to standard output and files. So, I can, for example, do the following:
Code:
(date; users; uptime;)| tee mylog.txt
How can I modify the code so that the output is appended to the file (not overwritten)?

Please notice that I want the output to both the STDOUT and the file.

Thanks in advance.
 
Old 07-01-2009, 04:01 AM   #2
Udi
Member
 
Registered: Jan 2009
Posts: 165

Rep: Reputation: 44
tee has a "-a" command-line option to do what you want.
Read the manual page 'man tee' for more info.
 
  


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 stdin in bash script artur Programming 3 12-09-2011 06:07 AM
redirecting /dev/ttyS0 -> stdin goestin Linux - Software 2 10-26-2011 11:34 AM
piping and redirecting files shtek Linux - Newbie 4 01-15-2008 09:39 AM
after redirecting stdin still need to read data from keyboard vrikers Programming 4 10-31-2004 06:11 AM
redirecting stdin and stdout with pipes: convincing apps they're for a terminal? prell Programming 1 09-02-2004 06:38 AM

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

All times are GMT -5. The time now is 11:25 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