0

I have a couple of commands that allow me to create a .tar archive and then extract the files from it.

I am using WSL and both commands work just fine if I enter them directly, but not if I run them as a .sh file - I get the find: missing argument to `-exec' error.

To create the .tar, I have:

find . -maxdepth 2 -mindepth 2 -type d -exec tar cvf {}.tar {} \;

And to extract files I have:

find . -name "*.tar" -exec tar xf {} \;

Where am I going wrong?

Kusalananda
  • 333,661

0 Answers0