0

What is the Linux shell equivalent of this Windows shell batch file command?

tar czf b.tgz --exclude="dontwant.tgz" @a.tgz

What I need to achieve:

  • a.tgz has many files including dontwant.tgz.
  • I want to create b.tgz such that it has all files in a.tgz except dontwant.tgz.
AdminBee
  • 22,803

1 Answers1

0

Check your Linux distro if there is a bsdtar (just type it into a terminal) and use this instead of tar. First one is FreeBSD (and therefore "macOS") Tar with your required "@" option, second one GNU Tar without it. My current system (Slackware based) has both.

Keep in mind that "tar" is a file format that can be handled by different programs with different features (though it started out some decades ago in UNIX as single program).

hh skladby
  • 41
  • 2