LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-26-2010, 12:56 AM   #1
ionrivera
Member
 
Registered: May 2010
Distribution: Debian, RHEL, AIX, Solaris, HP-UX
Posts: 61

Rep: Reputation: 4
How to redirect the output to multiple files without displaying it to the screen?


To redirect standard output to multiple files:

Code:
echo Test | tee file1 file2
My problem is that the word "Test" still displays to the screen? I want same effect as:
Code:
echo Test > file1
but with multiple file redirection.
 
Old 10-26-2010, 12:57 AM   #2
ionrivera
Member
 
Registered: May 2010
Distribution: Debian, RHEL, AIX, Solaris, HP-UX
Posts: 61

Original Poster
Rep: Reputation: 4
Thumbs up

I think I found the answer while typing this thread...

Code:
echo Test| tee file1 file2 > /dev/null
I tried redirecting it to /dev/null and it simply worked!
 
Old 10-26-2010, 12:59 AM   #3
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,138
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Ty this
Code:
echo Test | tee file1 | tee file2 > /dev/null

Last edited by prayag_pjs; 10-26-2010 at 01:01 AM.
 
Old 10-26-2010, 01:04 AM   #4
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,138
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Alos see this one

Code:
echo Test | tee file1 | tee file2 1 2&> test.txt
 
  


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
BASH: How to Redirect Output to File, AND Still Have it on Screen edwin11 Linux - Software 25 07-02-2012 06:12 PM
how to redirect the cron output to screen pingao777 Ubuntu 5 10-16-2010 09:24 AM
Redirect ALL terminal output to file and screen (for entire session) Mountain Linux - Software 9 07-08-2010 10:50 AM
redirect screen output to file timbuck Linux - Software 5 12-09-2005 06:57 PM
Redirect output to multiple places granny Linux - Newbie 1 02-12-2004 12:31 PM


All times are GMT -5. The time now is 05:43 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration