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?
dos2unix
to convert them to unix line endings. – pLumo Oct 11 '22 at 19:53Thanks ever so much!
– jim_e_jib Oct 11 '22 at 21:15tar
archive of a single file is pointless; you are only adding overhead, – tripleee Oct 12 '22 at 04:16