Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mms

macrumors 6502a
Original poster
Oct 8, 2003
784
0
CA
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.
 
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
 
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?
 
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).
 
Originally posted by mms
Thanks. I was trying to use rm and mv, because ls and cd were the same as on your local directory.
You were trying to be logical! :) You can use mkdir and rmdir too, if they are supported by the particular serve you are using.
Is there a way to move files?
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.