Deleting files

Advertisement

Guest

Deleting files

I want to remove all files in a specific directory on a remote machine and I am using sftp. My code looks like :

cd load/loadIn
ls
pwd
rm *.*

and I got the following errormessage:
rm /load/loadIn/*.*: no such file or directory

I have also tried to change the last line to delete files ending with .ok by writing :

rm *.ok

and I got the following errormessage:
rm /load/loadIn/*.ok: no such file or directory

So could anyone help me out to do this task ?

Regards
/Andreas

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Deleting files

SFTP protocol itself does not support wildcards, unless your client supports them. What client are you using? Why you do not try WinSCP?

Reply with quote

Guest

Re: Deleting files

martin wrote:

SFTP protocol itself does not support wildcards, unless your client supports them. What client are you using? Why you do not try WinSCP?

I have been told to use sftp by the client, because there are a lot of "secret" messages being sent over the net. The last step to be done is to delete the files on the remote machine that I have downloaded to the local one.

I know somehow that I have to do this recursively (i.e deleting the files), but I just dont know how ?

I have a batch-file calling the code above, but I dont know how to pass variables from it and receive them ?

Regards
/Andreas

Reply with quote

martin
Site Admin
martin avatar

Re: Deleting files

Anonymous wrote:

I know somehow that I have to do this recursively (i.e deleting the files), but I just dont know how ?
Well, use WinSCP :-), not sftp.

Reply with quote

Advertisement

You can post new topics in this forum