LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 09-30-2010, 01:31 AM   #1
cliper
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Rep: Reputation: 0
write a file and display in terminal at the same time...


how can we write a file and display in terminal at the same time...

like for example, when I do..

php -f file.php > testfile

that should save right.. but I want to display it in terminal otherwise..
any idea?
 
Old 09-30-2010, 01:36 AM   #2
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
Checkout the tee command

______________
Gerrard
 
Old 09-30-2010, 01:41 AM   #3
cliper
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by gdejonge View Post
Checkout the tee command

______________
Gerrard

yah, it should be the same with > right.. it appends or concatenate after | pipe right...
 
Old 09-30-2010, 02:10 AM   #4
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
man tee gives:

Code:
NAME
       tee - read from standard input and write to standard output and files
SYNOPSIS
       tee [OPTION]... [FILE]...
DESCRIPTION
       Copy standard input to each FILE, and also to standard output.
So you should use something like:
Code:
# php -f file.php | tee testfile
_____________
Gerrard
 
1 members found this post helpful.
Old 10-03-2010, 12:22 AM   #5
cliper
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Original Poster
Rep: Reputation: 0
thanks.
 
  


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
Real Time File Creation in Terminal Drigo Linux - Newbie 3 08-03-2010 10:05 AM
Live/real-time text-file updates in terminal SentralOrigin Linux - Software 2 01-13-2010 07:35 PM
File change notification every time I write to a network drive tatacalu Linux - Networking 5 09-09-2009 01:12 PM
Can you write a script to display file name, Inode, and size of any file? JaxsunApex Linux - Newbie 3 01-30-2007 09:39 AM
need multiple users to have read/write access to a Quickbooks file at the same time. rbelknap Linux - Security 2 10-14-2003 11:52 PM


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