How to extract a single file from tar to a different directory? [closed] How to extract a single file from tar to a different directory? [closed] unix unix

How to extract a single file from tar to a different directory? [closed]


The problem is that your arguments are in incorrect order. The single file argument must be last.

E.g.

$ tar xvf test.tar -C anotherDirectory/ testfile1

should do the trick.

PS: You should have asked this question on superuser instead of SO