title: Get list of files from FTP server
body: <p>I'm trying to get a list of all the files we have on a server ( specifically every pdf file we have there ). I've tried using total commander and search for the files. It worked to some extent, as in, i got a list of every pdf we had there, but no way of exporting the results ( we have 100.000+ files there )</p>
  
  <p>I've tried using a bash script to get the information, but i'm not very experienced with linux, and i don't really know what i'm doing.</p>
  
  <p>My script looks like this : </p>
  
  <pre><code>#!/bin/bash
  hostname="&lt;host&gt;"
  ftp -i -nv $hostname &lt;&lt; EOF
  user &lt;username&gt; &lt;password&gt;
  ls -R 
  EOF
  </code></pre>
  
  <p>Running the above script i get</p>
  
  <pre><code>?Invalid command
  501 Illegal PORT command
  ftp: bind: Address already in use
  221 Goodbye
  </code></pre>
  
  <p>Any help or pointing me on what to search would be greatly appreciated.</p>