1

I'm fairly new to WinSCP. I love having the "trash" feature, but of course I also want to occasionally quickly empty that "trash".

What would be a quick custom command to do that?

I believe this removes everything including the directory itself I'm right-clicking on:

test "!?Do you really want to delete ?no!" == "yes" && rm -rf !&

...but it would be great if I didn't have to delete and re-create the directory (since WinSCP doesn't automatically create it, when I delete a file and a /tmp directory is not present).

Would this work?

test "!?Do you really want to delete ?no!" == "yes" && rm -rf !&/*

I don't want to try it and accidentally delete everything in my root folder or something!

Any ideas?

  • question to moderators or expert users: does this question belong here or should it rather be on Stack Overflow? – nico Jan 29 '17 at 9:03
  • What's the point of !&/*? Use a fixed path to the recycle bin. – Martin Prikryl Feb 1 '17 at 11:00
1

Just delete only files in the recycle bin, using rm /path/to/recycle/bin/*.

A full custom command would be like:

test "!?Do you really want to delete ?no!" == "yes" && rm /path/to/recycle/bin/*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.