Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Given that I have this archive my_archive.tar.gz which has this file in it: README. How can I output the content of README without having to extract the archive?

OS: Debian 7

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Use z to (g)unzip, x to extract, with f from archive file. Then add also option -O to direct extracted files to standard output.

tar xzf my_archive.tar.gz folder/README.txt -O

Source

share|improve this answer
    
Thank you very much! –  Dragos Rizescu Jan 13 at 15:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.