Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I was just wondering, how I could download a file append the file name and directory append it. I.e I want to download this: gpo.zugaina.org/AJAX/Ebuild/2386214 and call it gcc-4.6.1.ebuild ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    4

    WGET question when downloading a file


    Hi,

    I was just wondering, how I could download a file append the file name and directory append it.
    I.e I want to download this: gpo.zugaina.org/AJAX/Ebuild/2386214 and call it gcc-4.6.1.ebuild within x directory.

    I tried
    Code:
    sudo wget gpo.zugaina.org/AJAX/Ebuild/2386214 -O gcc-4.6.1.ebuild --directory-append=/usr/local/portage/sys-devel/gcc
    however it would only download to the current directory.

    What am I doing wrong?

  2. #2
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    According to the wget man page, you need to append the -P option.

    Exaple:
    Code:
    sudo wget gpo.zugaina.org/AJAX/Ebuild/2386214 -P /pick/your/directory
    I just tried it, and it works.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  3. #3
    Just Joined!
    Join Date
    Sep 2010
    Posts
    4
    Quote Originally Posted by jayd512 View Post
    According to the you need to append the -P option.

    Exaple:
    Code:
    sudo wget gpo.zugaina.org/AJAX/Ebuild/2386214 -P /pick/your/directory
    I just tried it, and it works.
    Hi, yes, but you cant get wget get to rename 2386214 to be gcc-4.6.1.ebuild with that because you need the -O

  4. #4
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    I'm not sure about that one, as I don't use wget very often. I've seen multiple posts in various forums that this isn't easy to do with just one command.
    A possible solution would be to employ a double ampersand (&&) and rename after.
    sudo wget gpo.zugaina.org/AJAX/Ebuild/2386214 -P /pick/your/directory && mv /downloaded/file /new/name/file
    Might not be what you're looking for, but I hope that helps.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

Posting Permissions

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