LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-05-2002, 10:29 AM   #1
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Rep: Reputation: 16
Quick question about tar


If I have 20 .tar files in the same directory, what command should I use to un-tar them all at once?

tar -xvf *.tar does not work..Thanks in advance
 
Old 02-05-2002, 12:07 PM   #2
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 47
yeah and if i have 100 .tar archives in one dir how do i gzipped them all at once?
 
Old 02-05-2002, 12:08 PM   #3
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
You have to run the tar program seperatly for each file.

Code:
for x in *.tar; do tar xvf "$x"; done
should work (in bash at least)
 
Old 02-05-2002, 12:28 PM   #4
therion12
Member
 
Registered: Dec 2001
Location: chicago, IL
Distribution: Gentoo 1.4_rc1
Posts: 913

Rep: Reputation: 30
Yeah hes right you'll have to run a loop-like command for it to work. I'm not sure about TAR files if this works but try:

tar zxf *.tar.gz
 
Old 02-05-2002, 12:28 PM   #5
phil1076
Member
 
Registered: Oct 2001
Location: Grand Cayman
Distribution: RH 9.0
Posts: 96

Original Poster
Rep: Reputation: 16
ack! ok thanks, I think...
 
Old 02-05-2002, 01:12 PM   #6
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
Quote:
Originally posted by NSKL
yeah and if i have 100 .tar archives in one dir how do i gzipped them all at once?
for x in *.tar; do gzip "$x"; done
 
  


Reply



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 02:48 AM
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
Quick...Someone Tell Me How To Open a Tar File in .tgz format njschroe Linux - Software 3 06-10-2005 04:58 AM
Quick guide on tar bograt Linux - Newbie 11 01-27-2005 05:15 PM
samba smb.config question (quick question) TheDOGG Linux - Networking 1 03-02-2004 07:19 AM

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

All times are GMT -5. The time now is 04:30 PM.

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
Open Source Consulting | Domain Registration