How to extract specific file(s) using tar

If we want to extract specific file(s) from a VERY LARGE archive (eg. the file size is 6GB), we also can use tar to achieve this goal.

1. Find out the path name in archive file if you don’t know it via $ tar -tv -f {Archive file} | grep {File name}. And it will show the RELATED file path in the archive file after listing(-t) and filtering(grep).

2. Extract the file via $ tar -xv -f {Archive file} {File path}.

It is very easy, isn’t it?

Leave a Reply

Your email address will not be published. Required fields are marked *