Please forgive me is this has been asked before (I am new to this).
Using the "ls" command to list the files in a remote directory is easy enough. But what I would like to do it to redirect the output of this command to a disk file in the local directory (Windows). In essence, I am just trying to get a list of the files in the remote directory to use for other purposes.
I have looked through the documentation, but I don't see anything that addresses redirection like this.
For this simple task you may try using plink from PuTTY package instead. It allows you to execute a shell command on remote machine. This way you can use formatting capabilities of unix ls command (e.g. to display names only)
plink <user>:<host> -pw <password> ls > file.txt
Last edited by martin on 2008-08-29; edited 1 time in total
By the way, in reference to the topic of transferring files between two servers via a local workstation ...
I guess I am lucky ... from my Windows XP workstation, I have to deal with a Redhat Linux server as well as a Windows Server 2003 server. I found that if I make a mapped drive to a folder structure on the Windows server, WinSCP will treat that mapped drive as a local drive and the file transfers between the two remote servers works beautifully.
Just thought I would mention that in case someone else is in the same situation.