LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-07-2004, 10:09 AM   #1
danishmr
LQ Newbie
 
Registered: May 2002
Location: Lahore, Pakistan
Posts: 26

Rep: Reputation: 15
Need help with 'tar' command


Dear Experts

I have been using the tar command to take the backup and restore it using the followins simple commands

backup: tar -czvf <tar file name> <list of files to tar>
restore: tar -xzvf <tar file name>

However, how can one see the list of files in the tar without extracting? I have tried 'tar -t <tar file name>', but that does not work due to the fazt that I had used a 'z' flag while compressing it

Hence, how can I see a list of files and verify the validity of a tar created with a 'z' flag without untaring the file.

Thanks
 
Old 06-07-2004, 10:19 AM   #2
fluppi
Member
 
Registered: Oct 2003
Location: Switzerland (Europe)
Distribution: OpenSuSE, RedHat, Knoppix, IRIX + MacOSX
Posts: 198

Rep: Reputation: 31
tar -ztf Name.tar

And now some cool thing - make a tar stream through ssh:
tar -cvf - [name or path ] | ( ssh root@host tar -xvf - -C [targetpath] )
You can create a tar on a remote computer, without a local copy, very useful if the is not enough space left!

Hth
Fluppi
 
Old 06-07-2004, 10:34 AM   #3
TheOther1
Member
 
Registered: Feb 2003
Location: Atlanta, GA
Distribution: RHAS 2.1, RHEL3, RHEL4, SLES 8.3, SLES 9, SLES9_64, SuSE 9.3 Pro, Ubuntu, Gentoo
Posts: 335

Rep: Reputation: 32
Code:
gzip -dc [filename] | tar -t
If you want verbose info, add a v on the end:

Code:
gzip -dc [filename] | tar -tv
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
Tar command juanb Linux - General 4 11-03-2005 01:10 AM
tar command? xmdms Linux - General 4 10-07-2004 02:29 PM
tar command.. johnyy Linux - Software 4 12-31-2003 11:54 PM
Tar command satimis Linux - Newbie 3 11-03-2003 11:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration