LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-12-2004, 03:05 AM   #1
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Rep: Reputation: 38
Piping output to text files


Hi,
I 'd like to know if there's a way to pipe the output of a command to a text file.I guess that grep does it.But what is the syntax?Please advise.
 
Old 10-12-2004, 03:27 AM   #2
redjokerx
Member
 
Registered: Aug 2004
Location: San Diego
Distribution: Slackware
Posts: 303

Rep: Reputation: 31
Code:
$ cmd > textfile
to make a new file
Code:
$ cmd >> textfile
to appened (or create) a text file.

That only works for output in stdout. I don't know what to do if the output is stderr or something else.
 
Old 10-12-2004, 03:30 AM   #3
heema
Senior Member
 
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
ls > test.txt

it will put the output of ls to test.txt in the same directory
if u want to change the directory just add

ls > /your/dir/test.txt
 
Old 10-12-2004, 03:33 AM   #4
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Original Poster
Rep: Reputation: 38
Thanks fellows.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert DOS text files to UNIX text files ta0kira Linux - Software 7 03-15-2011 11:42 AM
squares in java application output text debikkel Linux - Software 1 08-31-2004 03:04 PM
Creating a postscript output from a image and text rdfoerster Linux - Software 3 08-31-2004 10:26 AM
a simple text output query dougp Linux - Newbie 1 09-05-2002 10:45 AM
Piping output to a text file joadoor Linux - Newbie 7 04-19-2002 03:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:22 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
Open Source Consulting | Domain Registration