LinuxQuestions.org
Help answer threads with 0 replies.
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 02-04-2006, 11:01 PM   #1
mus1402
LQ Newbie
 
Registered: Dec 2005
Distribution: Fedora Core 4
Posts: 12

Rep: Reputation: 0
How to redirect output to a file?


Anyone know how to redirect output to a file?
 
Old 02-04-2006, 11:11 PM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
add > filename in the command.
for example:
Code:
ls > ls_output
 
Old 02-05-2006, 09:42 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Good tutorials on redirection are out there. Google on "Linux redirection"

> send to file (create if neccesary)
>> append to file
< read from file
<< read from "here"--eg the terminal
2> redirect errors to file

you can also use "exec" to change file descriptors--eg for the life of a script or segment.
 
  


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
redirect screen output to file timbuck Linux - Software 5 12-09-2005 06:57 PM
how to redirect the soundcard output to a file? jr0 Linux - General 2 10-31-2005 06:29 AM
Is there a way in Linux/Unix bash to turn off output or redirect to a file jimwelc Linux - Newbie 6 01-06-2005 03:56 AM
How do I redirect sound card output to file ass0ciate Linux - Software 0 09-14-2004 03:41 PM
output from cpio won't redirect to file rawii Programming 5 01-27-2004 01:49 PM


All times are GMT -5. The time now is 02:36 PM.

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