[kwlug-disc] tar --directory help please

Ronald Barnes ron at ronaldbarnes.ca
Wed Jun 4 13:41:52 EDT 2025


Ronald Barnes via kwlug-disc wrote on 2025-06-04 10:33:

> errors with or without quotes around the path to archive:
> 
> # tar -vcf ffs.tar --directory=/ etc/systemd/system/mailm*
> tar: etc/systemd/system/mailm*: Cannot stat: No such file or directory
> tar: Exiting with failure status due to previous errors

Adding to this part, I expected the quotes to allow the wildcard to be 
passed to `tar`.

Yet removing the wildcard works:

# tar -vcf ffs.tar --directory=/ etc/systemd/system/mailman3.service 
etc/systemd/system/mailman3-web.service
etc/systemd/system/mailman3.service
etc/systemd/system/mailman3-web.service


This is unacceptable, I need to use a wildcard in some situations.

How do I pass the wildcard to `tar` without it expanding in the current 
directory?



More information about the kwlug-disc mailing list