SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    secure shell / unix command to dowload files?

    I'm new to the secure shell world and command line operations?

    I am secure shelling into a linux box and would like to download files I view on this box to my local hardrive.

    What are the commands to do this?

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You want to download files from the remote computer to your local one? You can put it in a Web directory (assuming one exists) and use your browser, use FTP, or attach it to an e-mail.

    The first method would be...
    Code:
    mv download.file /path/to/web/root/
    Then you would go to http://example.com/download.file to download it.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No web directory here. (Well there is one, but I don't have access to it for this reason).
    I need to download the file directly from the remote computer to my local computer.

  4. #4
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, then try mailing it to yourself.

    Code:
    uuencode download.file download.file | mail your@email.com
    Most mail user agents should be able to handle uuencoded attachments.

  5. #5
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't tried the email yet, but if that works, then that's cool, but not what I'm after (Don't want that extra step of going to my email client and then getting the file)

    Would like the one stop of downloading directly from remote to local - is this even possible?

  6. #6
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you install software on the server?

    If it's a relatively small file, you can just copy and paste.

  7. #7
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably don't have access to install software / since I'm a command line newbie, then that would be another task...

    Some files I can just copy and paste, that's no prob.

    But sometimes I'd like to download a complete directory for example.

    ----
    But, I guess, my bigger question that I'm getting at - Is this even possible, is their a command for the exact operation that i'm looking for?
    (I do appreciate the other methods to solve my problem)

  8. #8
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You dont have FTP access at all? I am sure you can use FTP...
    And if editing text files, use a program like ultraedit so that it auto uploads any changes made.
    Net-Trend.com - Full featured multi domain hosting solutions.
    RevoServe.com - Low cost multi domain hosting solutions. (Legal adult content acceptable)
    Providing quality shared and reseller accounts since 2002.

  9. #9
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe I'm not making myself clear enough.

    I'll give an example (two examples):
    1. I have a folder with 10 php files in it, I want to download that entire folder directly from my remote machine to my local machine.

    2. In usr/local/apache/conf/
    I want to download the httpd.conf file to my local machine.

    ---

    I don't want to do any of this via ftp.

  10. #10
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To my understanding there is no way to do this besides FTPing. You can even FTP when you are in the shell.
    Net-Trend.com - Full featured multi domain hosting solutions.
    RevoServe.com - Low cost multi domain hosting solutions. (Legal adult content acceptable)
    Providing quality shared and reseller accounts since 2002.

  11. #11
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    could you provide an example of that via ftp?
    (could I use ftp in the shell to take my httpd.conf to my local machine)???

  12. #12
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You want to transfer files, but you can't use HTTP, FTP, or email.

    You could set up an FTP server on your local computer and upload the files from the remote computer. That is really your only option if you have so many restraints.

  13. #13
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An example of using FTP in a SHELL.

    bash$ > FTP

    FTP > Open www.thedomain.name
    FTP > ls (list files)
    FTP > cd to_any_directory that you want
    FTP > [if the file is in this dir] get file.name
    FTP > [to upload]put file.name


    Hope that helps.


    BTW, you do know that you can edit the files directly in the shell right?

    If you don't try [pico or vi].
    Last edited by net-trend; Aug 27, 2002 at 09:55.
    Net-Trend.com - Full featured multi domain hosting solutions.
    RevoServe.com - Low cost multi domain hosting solutions. (Legal adult content acceptable)
    Providing quality shared and reseller accounts since 2002.

  14. #14
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for all the replies.

    I know this has been a bit of a strange request...
    Hopefully I'll be able to use the ftp method...
    thanks

  15. #15
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also remember that when working in SSH you are literally ON the remote computer. Generally without using FTP or email there is no way to SEND something to your local machine. Remember when in SSH, the server IS local and your OWN machine is remote... You have to login to some file transfer apparatus, whether FTP (which you can even get through a DOS prompt) or enail or a web browser. There IS no one-stop method.

    Aaron
    Aaron Brazell
    Technosailor



  16. #16
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Sketch,

    I think I was being naive.. I wasn't thinking of the larger picture, that being in ssh, that I was directly on the remote machine. I think I was trying to look at the ssh as the way I had done things before (via an ftp client).

    I need to do research before I get into this, but using the wget commmand will allow for the transfer of files from another machine to the one i'm secured shelled into, correct?

  17. #17
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    correct
    Aaron Brazell
    Technosailor




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
  •