Command Line FTP and Moving Files

Discussion in 'General Mac Discussion' started by mms, Feb 18, 2004.

  1. mms macrumors 6502a

    Joined:
    Oct 8, 2003
    Location:
    CA
    #1
    When using command line FTP, is it possible to move and rename files on the remote server? mv doesn't work and I can't find a command like that in ftp> help.
     
  2. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #2
    To rename a file on the server, use the command
    Code:
    rename oldname newname
    To delete a file from the server, use the command
    Code:
    delete filename
     
  3. mms thread starter macrumors 6502a

    Joined:
    Oct 8, 2003
    Location:
    CA
    #3
    Thanks. I was trying to use rm and mv, because ls and cd were the same as on your local directory. Is there a way to move files?
     
  4. Westside guy macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy side of the Pacific NW
    #4
    Boy most of the servers I work with anymore don't allow FTP because it's totally insecure! But delving into the depths of my memory...

    The commands available are going to vary, depending on the daemon that's being used on the server. If you want to see what commands are available, just typing a question mark ("?") from the ftp prompt will usually generate a list.

    If you aren't sure what a particular command does, you can usually type "help command_name" (replace "command_name" with the actual command you want info on; for example "help mkdir" will give a brief description of what mkdir does).
     
  5. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #5
    You were trying to be logical! :) You can use mkdir and rmdir too, if they are supported by the particular serve you are using.
    I assume you meaning moving a file from one directory to another, since you can already use the rename command to "move" a file to another name in the same directory. There is no specific command for moving files that I have heard of. You could try "rename foo ../foo" or "rename foo bar/foo" but I doubt that works. So the only way to "move" a file is to get it, delete it, cd somewhere, and put it again.
     
  6. mms thread starter macrumors 6502a

    Joined:
    Oct 8, 2003
    Location:
    CA
    #6
    Thanks everyone. I was using the help command in ftp but I was unable to find any command that would move files from one directory to another, which was why I was asking. Although Transmit is great, I have found that command line ftp works fine for me, without paying the shareware price.
     

Share This Page