Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 09-21-2006, 12:15 PM   #1
Registered: Nov 2003
Location: Huntsville, AL
Distribution: RHEL, Solaris, OSX, SuSE
Posts: 417

Rep: Reputation: 31
Capture output from another computer

I was wondering if anyone could tell me the best way to list data from another linux machine and save the output to a file on the local machine.

I have two machines using a passwordless entry with ssh. I want to list the directories of the remote machine and have the output saved onto my local machine.

When I run:

ssh remoteLinux ls /tmp
I can see a list of files on the remote machine. I just want a the screen output to be placed in a file on my local machine.

Thanks for the help! I'm sure this is an easy one.
Old 09-21-2006, 12:22 PM   #2
Registered: Nov 2003
Location: Huntsville, AL
Distribution: RHEL, Solaris, OSX, SuSE
Posts: 417

Original Poster
Rep: Reputation: 31
I think I figured it out.

ssh remoteLinux ls /tmp >>/home/mijohnst/filelist.txt
I don't know what I was doing before, but now when I put the ">>/home/mijohnst/filelist.txt" it does save it to a local file.
Old 09-21-2006, 03:58 PM   #3
Registered: Sep 2003
Posts: 71

Rep: Reputation: 15
As you've figured out then - putting > filename.txt after any command will redirect the standard out (console) to a file instead.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
capture the output to a variable Melsync Linux - General 4 09-07-2006 02:17 PM
Bash script- capture cdparanoia text output code-breaker Linux - Software 7 08-03-2006 10:13 PM
can't capture 'at' command standard output to a file bartoni Linux - General 3 02-28-2006 03:52 PM
Capture 'make' Output to File Kenji Miyamoto Linux - Software 4 05-23-2005 05:56 PM
capture make's output gboutwel Linux - Newbie 2 07-07-2002 05:15 AM

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