Solved

Reading contents of Rel223_NIMS_ASC_PLSQL_20061121_01.tar file

Posted on 2006-11-21
4
247 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
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
g++ pthread_init failure on AIX 10 69
Oracle Finace 3 66
Linux: disable vim auto-comment 7 91
replace column/record content in a *csv file based on a regular expression 6 52
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now