Skip to main content
deleted 4 characters in body
Source Link
Stéphane Chazelas
  • 584.5k
  • 96
  • 1.1k
  • 1.7k

If you can't run tar directly from the shell, but can run it from a different command, then you can do:

env tar xvf file.tar file1
find . -prune -exec tar xvf file.tar file1 ';'
perl -e 'exec @ARGV' tar xvf file.tar file1 ';'

However, that still runs tar, so you would likely still be infringing at least the spirit of the law that forbids you from running tar.

Instead of tar, you could also run pax instead (that's the POSIX command for dealing with archives).

pax -r < file.tar file1

If you can't run tar directly from the shell, but can run it from a different command, then you can do:

env tar xvf file.tar file1
find . -prune -exec tar xvf file.tar file1 ';'
perl -e 'exec @ARGV' tar xvf file.tar file1 ';'

However, that still runs tar, so you would likely still be infringing at least the spirit of the law that forbids you from running tar.

Instead of tar, you could also run pax instead (that's the POSIX command for dealing with archives).

pax -r < file.tar file1

If you can't run tar directly from the shell, but can run it from a different command, then you can do:

env tar xvf file.tar file1
find . -prune -exec tar xvf file.tar file1 ';'
perl -e 'exec @ARGV' tar xvf file.tar file1

However, that still runs tar, so you would likely still be infringing at least the spirit of the law that forbids you from running tar.

Instead of tar, you could also run pax instead (that's the POSIX command for dealing with archives).

pax -r < file.tar file1
Source Link
Stéphane Chazelas
  • 584.5k
  • 96
  • 1.1k
  • 1.7k

If you can't run tar directly from the shell, but can run it from a different command, then you can do:

env tar xvf file.tar file1
find . -prune -exec tar xvf file.tar file1 ';'
perl -e 'exec @ARGV' tar xvf file.tar file1 ';'

However, that still runs tar, so you would likely still be infringing at least the spirit of the law that forbids you from running tar.

Instead of tar, you could also run pax instead (that's the POSIX command for dealing with archives).

pax -r < file.tar file1