How do I pipe the output of an LS on remote server to the local filesystem via SFTP?
问题 I'm logged into a remote server via SFTP at the command line. The folder I'm in contains hundreds of thousands of files. I need to get a list of these files in a text file so I can access them programmatically, as none of the PHP SFTP clients are able to return such a large list of files. When I run an ls on the directory ( within the SFTP session ), it takes about 20 minutes for the file list to finally display. I don't have write access on this server, so I can't pipe the output to a file