How can I quit Terminal after deleting files?

Easiest fix is to not use Terminal!

Try using an "Execute Shell Script" action instead, putting your command in that -- the macro will then delay until the script step completes which (unless you've set it to "asynchronous") will be after the file deletion has completed:

Also worth noting that the "Delete File" action has a "Delete" option which similarly completely deletes a file without warnings and without using the Trash. So you could keep the whole process within KM, without the "Execute Shell Script" step, by creating a file Collection then doing For Each on that.

1 Like