Help: FTP File List - Networking

This is a discussion on Help: FTP File List - Networking ; Hello, I'm a system administrator, and I wanna get a file list from ftp. For example, I've logged in the ftp site, I type "ls" to see the list. How can I save this list in my disk? Thank you ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Help: FTP File List

  1. Help: FTP File List

    Hello,

    I'm a system administrator, and I wanna get a file list from ftp. For
    example, I've logged in the ftp site, I type "ls" to see the list.

    How can I save this list in my disk?

    Thank you very much~

    Regards,

    Amy Lee

  2. Re: Help: FTP File List

    Amy Lee wrote:

    > Hello,
    >
    > I'm a system administrator, and I wanna get a file list from ftp. For
    > example, I've logged in the ftp site, I type "ls" to see the list.
    >
    > How can I save this list in my disk?


    wget [url] gets a direcory listening and saves it as a HTML file if no other
    input is specified. It can probably be told to do otherwise. Or parsed
    though html2txt or something similar.

    --
    Lasse Jensen [fafler at g mail dot com]
    Linux, the choice of a GNU generation.

  3. Re: Help: FTP File List

    On Sun, 22 Jul 2007 17:08:15 +0200, Lasse Jensen wrote:

    > Amy Lee wrote:
    >
    >> Hello,
    >>
    >> I'm a system administrator, and I wanna get a file list from ftp. For
    >> example, I've logged in the ftp site, I type "ls" to see the list.
    >>
    >> How can I save this list in my disk?

    >
    > wget [url] gets a direcory listening and saves it as a HTML file if no other
    > input is specified. It can probably be told to do otherwise. Or parsed
    > though html2txt or something similar.


    Thank you. However, would you like to give me an example?

  4. Re: Help: FTP File List

    On 22 Juli, 16:33, "Amy Lee" wrote:

    Hello Amy!

    >
    > How can I save this list in my disk?
    >


    Amy, I have a solution to your problem using at least the ordinary ftp
    client in Unix/Linux/Whatever.
    If I in the FTP program type 'ls > lsout.txt' I will get the result of
    the ls command piped to a text file called 'lsout.txt' in my home
    directory. But be carful to type the spaces in 'ls > lsout.txt', when
    I tried my normal sloppy 'ls>lsout.txt' the command failed for me at
    least.
    So on my Debain system I will end up with a file with the full address
    of '/home/mahe/lsout.txt', that contains the directory entries as
    listed by the ls command.
    No, you did not tell us what system and tools you are using, but this
    is on the assumption that you are using some kind of Unix/Linux/*BSD
    system relative.

    Regards Mathias


  5. Re: Help: FTP File List

    On Sun, 22 Jul 2007 22:33:01 +0800, Amy Lee
    wrote:

    > I'm a system administrator, and I wanna get a file list from ftp. For
    > example, I've logged in the ftp site, I type "ls" to see the list.
    >
    > How can I save this list in my disk?


    You could use wget. From the man page:

    · If you specify a directory, Wget will retrieve the directory
    list‐ing, parse it and convert it to HTML. Try:

    wget ftp://ftp.gnu.org/pub/gnu/
    links index.html


    --
    -| Bob Hauck
    -| "Reality has a well-known liberal bias." -- Stephen Colbert
    -| http://www.haucks.org/

  6. Re: Help: FTP File List

    On Sun, 22 Jul 2007 15:47:42 +0000, mathias.heine wrote:

    > On 22 Juli, 16:33, "Amy Lee" wrote:
    >
    > Hello Amy!
    >
    >>
    >> How can I save this list in my disk?
    >>

    >
    > Amy, I have a solution to your problem using at least the ordinary ftp
    > client in Unix/Linux/Whatever.
    > If I in the FTP program type 'ls > lsout.txt' I will get the result of
    > the ls command piped to a text file called 'lsout.txt' in my home
    > directory. But be carful to type the spaces in 'ls > lsout.txt', when
    > I tried my normal sloppy 'ls>lsout.txt' the command failed for me at
    > least.
    > So on my Debain system I will end up with a file with the full address
    > of '/home/mahe/lsout.txt', that contains the directory entries as
    > listed by the ls command.
    > No, you did not tell us what system and tools you are using, but this
    > is on the assumption that you are using some kind of Unix/Linux/*BSD
    > system relative.
    >
    > Regards Mathias


    Thank you. But it dosen't support my system.
    My system is Redhat 9 with 2.4.20-8, I use normal ftp version. When I type
    "ls > /root/1.txt" in "ftp>", it can make 1.txt file, but it's empty.

    Would you like to tell me the solution?

    Regards,

    Amy



  7. Re: Help: FTP File List

    Amy Lee coughed up some electrons that declared:

    > Hello,
    >
    > I'm a system administrator, and I wanna get a file list from ftp. For
    > example, I've logged in the ftp site, I type "ls" to see the list.
    >
    > How can I save this list in my disk?
    >
    > Thank you very much~
    >
    > Regards,
    >
    > Amy Lee


    Hi

    Install ncftp, then you get a suite of commands including:

    ncftpls

    HTH

    Tim


  8. Re: Help: FTP File List

    Amy Lee wrote:
    > Hello,
    >
    > I'm a system administrator, and I wanna get a file list from ftp. For
    > example, I've logged in the ftp site, I type "ls" to see the list.
    >
    > How can I save this list in my disk?
    >
    > Thank you very much~
    >
    > Regards,
    >
    > Amy Lee


    RTFM?

    ls [remote-directory] [local-file]
    Print a listing of the contents of a directory on the remote
    machine. The listing includes any system-dependent informa*
    tion that the server chooses to include; for example, most
    UNIX systems will produce output from the command `ls -l'.
    (See also nlist.) If remote-directory is left unspecified,
    the current working directory is used. If interactive
    prompting is on, ftp will prompt the user to verify that the
    last argument is indeed the target local file for receiving
    ls output. If no local file is specified, or if local-file
    is `-', the output is sent to the terminal.

    Jerry



+ Reply to Thread