I use the following command for zipping each file in a folder separately:
for file in *; do gzip "$file"; done
But it keeps the original files. I want to know if there is a way to delete the files automatically after they’re successfully gzipped.
Thanks.
I don’t understand the issue you’re having. According to the gzip man page:
My only guess is you’re having permissions issues. Make sure you’re logged in as the owner of the file that you are gzipping. However, in the gzip version on my machine, I get an obvious
Operation not permittedwarning when I try to gzip a file that I don’t own. The operation still succeeds, but it’s clear what is going on.