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 09-24-2005, 06:20 PM   #1
Registered: Jun 2004
Location: Potsdam, NY
Distribution: Fedora Core 6
Posts: 201

Rep: Reputation: 30
Output the result of a command to a file

I was wondering how I can take the result of running a command (such as `ls') and outputting the result to a file. Thanks for any help.

EDIT: Oops, I remembered `ls > file.txt'

Last edited by darkarcon2015; 09-24-2005 at 06:22 PM.
Old 09-24-2005, 06:29 PM   #2
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Or "ls > file". Extensions have no meaning in Linux, so there's no need to put the .txt. (Really just posting so others don't think the problem hasn't been solved.)


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
Command line to get output on a file satimis Programming 4 06-24-2005 06:04 AM
How to write down result of performance of a command in a file ukrainet Linux - Newbie 3 12-08-2004 09:51 AM
php: output the result of exec( $command ) zovres Programming 6 08-27-2004 06:41 PM
how to use the output of a file for input of a command sneak Linux - General 2 05-12-2004 09:21 AM
Help: Command Output to File. rvijay Linux - Newbie 3 09-30-2003 09:02 AM

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