Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Print a file content from a tar.gz archive

I would like to print a single file content from a tar.gz archive.

I know I can list the files from the archive like so:

$ tar -tf openjdk-17.0.2_linux-aarch64_bin.tar.gz
[...snip...]
jdk-17.0.2/lib/server/libjsig.so
jdk-17.0.2/lib/server/libjvm.so
jdk-17.0.2/lib/src.zip
jdk-17.0.2/lib/tzdb.dat
jdk-17.0.2/release      <---- print the content of this file (with 'cat' or 'more')

I want to print the content of the file jdk-17.0.2/release, preferably without extracting it if possible.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use vim instead, and then browse using your cursor:

vim openjdk-17.0.2_linux-aarch64_bin.tar.gz

Alternatively, have a look at this thread.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading