Results 1 to 5 of 5

Thread: Getting a list of files from an ftp server

  1. #1
    Join Date
    Apr 2009
    Beans
    252
    Distro
    Xubuntu 20.04 Focal Fossa

    Getting a list of files from an ftp server

    Hi all,

    This is what I did:

    Code:
    ftp> ls > filelist.txt
    ftp> output to local-file: filelist.txt? y
    200 PORT command successful
    150 Opening ASCII mode data connection for file list
    450 >: No such file or directory
    ftp>
    (emphasis mine to highlight user input)

    This creates a local file filelist.txt but its empty.

    Thanks for reading. I'd appreciate any help with this.

  2. #2
    Join Date
    Nov 2008
    Location
    Sheffield, UK
    Beans
    1,514
    Distro
    Ubuntu

    Re: Getting a list of files from an ftp server

    does
    Code:
    ls
    display the list as expected?

  3. #3
    Join Date
    Nov 2008
    Location
    Sheffield, UK
    Beans
    1,514
    Distro
    Ubuntu

    Re: Getting a list of files from an ftp server

    Code:
     ls . filelist.txt

  4. #4
    Join Date
    Apr 2009
    Beans
    252
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Getting a list of files from an ftp server

    Quote Originally Posted by SlugSlug View Post
    Code:
     ls . filelist.txt
    That did it. Thanks!

  5. #5
    Join Date
    Aug 2012
    Beans
    5

    Re: Getting a list of files from an ftp server

    That works good. How would I go about getting a list of only the file names?

    I tried

    Code:
    ls -m1 . /list.txt
    but doesn't work. Just says

    usage: ls remote-directory local-file

    by itself it gives me the correct output.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •