The Blog

Linux commands to extract file from archive Posted on

To find a file in the archive use:


tar -xvjf backup.tar.bz2 | grep {file_name}

To restore a file from the archive use:


$ tar -xvf {tarball.tar} {path/to/file}
$ tar -zxvf tarball.tar.gz etc/some/file
$ tar -xvjf tarball.tar.bz2 etc/some/file <- did not work, (extracted whole archive)

This entry was posted in Uncategorized. Bookmark the permalink.

Please Post Your Comments & Reviews

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



CAPTCHA
Change the CAPTCHA codeSpeak the CAPTCHA code