some_bloody_fool
some_bloody_fool

Reputation: 4685

How to put files on a server and remove the local copy using command line ftp

I am learning cmd line ftp and was wondering how i can transfer a file to a remote directory while simultaneously removing the local copy.

Is this possible ?

I don't wan't to transfer and then run a delete command, but so far all i have is:

mput *xml

Which doesn't remove the local copy

Upvotes: 0

Views: 1327

Answers (1)

cadizm
cadizm

Reputation: 946

You can execute arbitrary shell commands from within most command line ftp programs w/ a bang (!). So I guess you could do:

ftp> !pwd
/home/foo_user
ftp> mput *xml
ftp> ! rm *xml

But I think this might be kind of dangerous since you might inadvertently delete something important

Upvotes: 1

Related Questions