0

I am trying to compress all files and folders in the current folder (on my Windows 10 environment) so I can extract them on my Raspbian environment. Im using a Powershell script with the tar command

tar -cvzf output.tar.gz .

From all that I read, tar is recursive by default, but Im finding that despite my best efforts I cant get it to compress anything other than the files in the root of the folder.

If I populate the directory with some test files and folders (named file1.txt, file2.txt and subfolder respectively, which also contains two test files) then tar works as expected and includes the subfolder!

I suspected that this was perhaps a privileges issue, so I ran powershell as Administrator but the result was the same.

The contents of the directory are coming from a Publish from Visual Studio -- thats the only thing I can see which might be causing the problem. I just dont know what the problem is.

3
  • Maybe the files are beeing used and blocked for reading. Have you tried copying them to another location? Commented Jul 5, 2022 at 8:37
  • try with tar -cvzf output.tar.gz * Commented Jul 5, 2022 at 10:03
  • Thanks for the suggestions chaps. Unfortunately tried both with the same results each time.
    – Jimbo
    Commented Jul 12, 2022 at 11:39

0

You must log in to answer this question.

Browse other questions tagged .