Downloading from FTP using wildcards on Command Line

6,835

Just let the -g away it disables globbing which means that the wildcaracter expansion is also turned off. Have a look here http://unixhelp.ed.ac.uk/CGI/man-cgi?ftp

Share:
6,835

Related videos on Youtube

bmgh1985
Author by

bmgh1985

I dabble in some coding!

Updated on September 18, 2022

Comments

  • bmgh1985
    bmgh1985 over 1 year

    We access an FTP site that has files on it, saved daily with the date in the form YYYYMMDD. What I am trying to do is run FTP in the command line to download all files with YYYYMMDD in them. Currently I have the following going through the FTP:

    binary
    cd /Outgoing
    lcd c:\temp\FTP\files
    mput *20140312*
    Quit
    

    Unfortunately, when I get to the line mput *20140312*, I get The filename, directory name, or volume label syntax is incorrect.. When I run it as mput 946_20140312_040000.csv it works fine. I am running ftp with the -i and -g commands to allow for wildcards and to do it without prompts.

    Ideally, I would like to get this working with the built in FTP functionality and would install another command line client as a last resort.

    Thanks

  • bmgh1985
    bmgh1985 about 10 years
    Ah, for some reason I had it in my head that it was off by default. Thanks