Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-05-2006, 12:01 AM   #1
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-05-2006, 12:11 AM   #2
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

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

Rep: Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741
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.


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 07:57 PM
how to redirect the soundcard output to a file? jr0 Linux - General 2 10-31-2005 07: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 04:56 AM
How do I redirect sound card output to file ass0ciate Linux - Software 0 09-14-2004 04:41 PM
output from cpio won't redirect to file rawii Programming 5 01-27-2004 02:49 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration