Find the answer to your Linux question:
Results 1 to 6 of 6
Hi dudes! This has to be the lamest question ever... I have 2 Linux servers and I simply want to download files from one to another using my shell. Can ...
  1. #1
    Just Joined! JVonD's Avatar
    Join Date
    Jul 2009
    Location
    Boulder, CO USA
    Posts
    3

    Cool Basic Shell Command Line Downloading

    Hi dudes! This has to be the lamest question ever...
    I have 2 Linux servers and I simply want to download files from one to another using my shell.
    Can you please tell me how I can download files using command line within my shell without running an FTP app?

    I access them remotely through a browser control panel and run commands with putty. I have no access to the servers locally so I can't see the desktop.

    THANKS DUDES! ~J

  2. #2
    Just Joined! jaysunn's Avatar
    Join Date
    Apr 2009
    Location
    New York City - USA
    Posts
    18
    You can use scp:

    Code:
    prompt>scp root@server:/directory/directory/filename .
    This will copy the file to what ever directory you are in. Most likely your home directory.


    Jaysunn

  3. #3
    Just Joined! JVonD's Avatar
    Join Date
    Jul 2009
    Location
    Boulder, CO USA
    Posts
    3
    Thanks a bunch jaysunn. I guess I'm a little confused. Where would I put the web address.

    prompt>scp root@jvond.com:/cd/2009-04-20_JVonD_...yStephanie.zip
    Said command not found.
    Basically want to be able to download a file via http using command. Trip out to that MP3 CD if you like.. =)

  4. #4
    Just Joined! jaysunn's Avatar
    Join Date
    Apr 2009
    Location
    New York City - USA
    Posts
    18
    Ok,

    Try this. Open up a terminal on a linux machine. And issue this command. Make sure you have access to the other server. I tried to use wget and anonymous is not setup.

    Code:
    [root@server ~]# scp username@64.150.166.129:/path/to/file .
    username@64.150.166.129's password:
    Make sure you have the . at the end. That instructs to place the file in your current working directory. Enter your password and you should be all set. I know the server has ssh abilities cause I received a password prompt. Let me know how you make out.

    If you are on a Windows machine, we will need to use pscp.exe.

    You can try this as well:

    Code:
    prompt#>wget http://filesWebAddress
    This should bring the file to your current working directory.

    Jaysunn

  5. #5
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    I'd like to go into a bit more detail.

    There is software called ssh, which stands for Secure Shell. ssh allows you to login remotely to another system and work on it as though you were actually at that computer. It is quite powerful. In order for it to work, however, the remote computer must be running sshd (the ssh daemon) in order to accept incoming ssh connections.

    scp is a command that uses the ssh protocol to copy a file over a network. It works like jaysunn said:
    Code:
    scp user@remotehost:/path/to/file /local/destination
    I am a bit confused, though. You said that you want to use the HTTP protocol. If this is true, you can use the "wget" utility:
    Code:
    wget http://www.linuxforums.org
    where the URL that you want to get is replaced with what you want, obviously.


    To use SSH, you will need to install those utilities, which are in a package called openssh (the particular ssh implementation that we use in Linux). wget is in the wget package.

    I hope this helps.


    EDIT:

    Doh. jaysunn mentioned wget too .
    DISTRO=Arch
    Registered Linux User #388732

  6. #6
    Just Joined! JVonD's Avatar
    Join Date
    Jul 2009
    Location
    Boulder, CO USA
    Posts
    3

    Wget

    Thanks for the wget command. Worked great!

    Use WGET command.

    wget http .. yoursite .. file.tar

    I had to exclude some of the address above because this forum is denying me.


    Thanks dudes! ~J

Posting Permissions

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