[kwlug-disc] tar --directory help please

John Van Ostrand john at vanostrand.com
Wed Jun 4 16:06:55 EDT 2025


On Wed, Jun 4, 2025 at 3:07 PM Ronald Barnes via kwlug-disc <
kwlug-disc at kwlug.org> wrote:

> Anton Avramov wrote on 2025-06-04 11:14:
>
> Normally I'd use a subshell and `cd`:
>
> ( cd / ; tar ... etc/systemd/system/mailman* )
>

I used to do that a long time ago, until I fat-fingered a directory or two
and got a tar of something I didn't want. Now I do this:

(cd /dir/dir/dir   &&  tar .....)

That way if the directory doesn't exist the tar doesn't go off wildly.

-- 
John Van Ostrand
At large on sabbatical
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20250604/27ce0aba/attachment.htm>


More information about the kwlug-disc mailing list