?
Solved

Reading contents of Rel223_NIMS_ASC_PLSQL_20061121_01.tar file

Posted on 2006-11-21
4
Medium Priority
?
265 Views
Last Modified: 2010-04-21
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.
0
Comment
Question by:aman_greval
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 2000 total points
ID: 17993758
What exactly do you mean by "read the contents"?  Do you mean you want to extract and see the contents of a specified file?

If so, then do

gzip -dc Rel223_NIMS_ASC_PLSQL_20061121_01.tar.gz | tar xf - del_20061121_01/plsql/install_nims20061121_01.sql ; cat del_20061121_01/plsql/install_nims20061121_01.sql
0
 

Author Comment

by:aman_greval
ID: 17994989
tar xf - del_20061121_01/plsql/install_nims20061121_01.sql

why this dash here; i did it without it
0
 
LVL 48

Expert Comment

by:Tintin
ID: 17998798
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
0
 

Author Comment

by:aman_greval
ID: 18000162
Thanks for your help Tintin!!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question