LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-22-2009, 04:00 AM   #1
JohnnyBoy123
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Rep: Reputation: 0
tee for two


Hi,

echo Hi
will print to screen.
echo bye > file.txt
will be redirected to a file.
echo hi | tee file1.txt
will direct to screen AND file1.txt
echo hi | tee file1.txt file2.txt
will direct to screen AND file1.txt AND file2.txt

question: how do I stop the printing to screen?
I want to redirect to two files but not the screen.
 
Old 04-22-2009, 04:12 AM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
And two for tee.

Try 'echo Hi | tee file1.txt > file2.txt'

Dave
 
Old 04-22-2009, 07:36 PM   #3
JohnnyBoy123
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ilikejam View Post
And two for tee.

Try 'echo Hi | tee file1.txt > file2.txt'

Dave

The above did not work on my system, but the line below does work.

{ echo hi| tee file1.txt file2.txt;} > /dev/null
 
Old 04-22-2009, 07:48 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by JohnnyBoy123 View Post
The above did not work on my system, but the line below does work.

{ echo hi| tee file1.txt file2.txt;} > /dev/null
How odd ... what shell are you using?
 
  


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
Tee shirt graphics andrew375 General 4 11-03-2007 12:26 AM
problem using tee | adventure xlq Linux - General 3 05-25-2007 03:22 PM
How to create a log File using tee?? rmvinodh123 Programming 1 04-12-2007 02:21 AM
tee vs > or >> DotHQ Linux - General 3 08-23-2006 01:31 PM
Sweet Slackware Tee for your favorite girlie! ming0 Slackware 2 11-10-2003 12:39 AM


All times are GMT -5. The time now is 03:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration