Link to home
Start Free TrialLog in
Avatar of aman_greval
aman_greval

asked on

Reading contents of Rel223_NIMS_ASC_PLSQL_20061121_01.tar file

I have a tar file: Rel223_NIMS_ASC_PLSQL_20061121_01.tar.gz

I uncompressed the file with:
gunzip Rel223_NIMS_ASC_PLSQL_20061121_01.tar.gz
and it became Rel223_NIMS_ASC_PLSQL_20061121_01.tar

Now i used
tar -xvf Rel223_NIMS_ASC_PLSQL_20061121_01.tar
and unix showed me contents of the above file

$ tar -xvf Rel223_NIMS_ASC_PLSQL_20061121_01.tar
x del_20061121_01, 0 bytes, 0 tape blocks
x del_20061121_01/plsql, 0 bytes, 0 tape blocks
x del_20061121_01/plsql/1_conk_prod_ST.sql, 97337 bytes, 191 tape blocks
x del_20061121_01/plsql/install_nims20061121_01.ksh, 827 bytes, 2 tape blocks
x del_20061121_01/plsql/install_nims20061121_01.sql, 594 bytes, 2 tape blocks
x del_20061121_01/docs, 0 bytes, 0 tape blocks
x del_20061121_01/docs/Rel223_NIMS_ASC_PLSQL_20061121_01_i10.doc, 58880 bytes, 115 tape blocks

All these files are shell, pl/sql files.
I want to read the induvidual files. i.e. i want to read the contents of
del_20061121_01/plsql/install_nims20061121_01.sql etc
how can i do this.
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aman_greval
aman_greval

ASKER

tar xf - del_20061121_01/plsql/install_nims20061121_01.sql

why this dash here; i did it without it
The - in conjunction with the tar -f flag means that the "file" tar is reading from is stdin.

This is useful to pipe tar output to the tar command.

In your original post, you uncompressed the tar file.  There's no need to do that if you do

gzip -dc file.tar.gz | tar xvf -

or if you have a Linux system or system where tar recognises the -z flag, you can simply do

tar zxvf file.tar.gz
Thanks for your help Tintin!!