tar file

tar file

Post by lezaw.. » Thu, 18 Dec 1997 04:00:00



Hi, I am new in UNIX/Solaris, I have 10 files say file1.txt ... file10.txt
how can I make tar file for all these files. TIA. leza

 
 
 

tar file

Post by Mike » Thu, 18 Dec 1997 04:00:00


try tar xvf myfile.tar *.txt in the directory where these files live
(not necessarily required - but it makes it easier when you untar them)


> Hi, I am new in UNIX/Solaris, I have 10 files say file1.txt ... file10.txt
> how can I make tar file for all these files. TIA. leza

--
         MICHAEL J. MINAMOTO
Please remove *NOSPAM* in your reply.

"Any sufficiently advanced technology
is indistinguishable from magic."
                      Arthur C. Clark

 
 
 

tar file

Post by Mike » Thu, 18 Dec 1997 04:00:00


Mike has egg on his face and is red with embarra*t

That should be tar cvf myfile.tar *.txt - sorry about that


> try tar xvf myfile.tar *.txt in the directory where these files live
> (not necessarily required - but it makes it easier when you untar them)


> > Hi, I am new in UNIX/Solaris, I have 10 files say file1.txt ... file10.txt
> > how can I make tar file for all these files. TIA. leza

> --
>          MICHAEL J. MINAMOTO
> Please remove *NOSPAM* in your reply.

> "Any sufficiently advanced technology
> is indistinguishable from magic."
>                       Arthur C. Clark

--
         MICHAEL J. MINAMOTO
Please remove *NOSPAM* in your reply.

"Any sufficiently advanced technology
is indistinguishable from magic."
                      Arthur C. Clark

 
 
 

tar file

Post by Malka Friedm » Fri, 19 Dec 1997 04:00:00



>try tar xvf myfile.tar *.txt in the directory where these files live

This is wrong! xvf is use to exctract files from tar file!!
You should do the following instead:
To get one tar file from all the files you need to use:
   tar cvf myfile.tar *.txt ( in the directory where these files live)
To extract the tar file you use the xvf flags as follow:
   tar xvf myfile.tar
>(not necessarily required - but it makes it easier when you untar them)

>> Hi, I am new in UNIX/Solaris, I have 10 files say file1.txt ... file10.txt
>> how can I make tar file for all these files. TIA. leza
>--
>         MICHAEL J. MINAMOTO
>Please remove *NOSPAM* in your reply.
>"Any sufficiently advanced technology
>is indistinguishable from magic."
>                      Arthur C. Clark

 
 
 

tar file

Post by Quan T » Fri, 19 Dec 1997 04:00:00


Perhaps you mean to says:
tar cvf myfile.tar *.txt


> try tar xvf myfile.tar *.txt in the directory where these files live
> (not necessarily required - but it makes it easier when you untar them)


> > Hi, I am new in UNIX/Solaris, I have 10 files say file1.txt ... file10.txt
> > how can I make tar file for all these files. TIA. leza

> --
>          MICHAEL J. MINAMOTO
> Please remove *NOSPAM* in your reply.

> "Any sufficiently advanced technology
> is indistinguishable from magic."
>                       Arthur C. Clark

 
 
 

tar file

Post by Erik W. Anders » Fri, 19 Dec 1997 04:00:00



Quote:>Hi, I am new in UNIX/Solaris, I have 10 files say file1.txt ... file10.txt
>how can I make tar file for all these files. TIA. leza

UNIX> tar cvf /tmp/test.tar `ls file[0-9].txt file[0-9][0-9].txt`

This will create a "tar" file in "/tmp" containing >>all<< files in
the current directory that start with "file", contain one or two
numeric digits, and end with ".txt".

P.S. I'm sure some UNIX guru out there has a better method of
extracting those files names and passing them to tar :)

--
Erik W. Anderson, GIS Analyst   WWW:    http://www.wa.gov/kitsap/

614 Division St., MS-36         Voice:  (360) 895-3743
Port Orchard, WA 98366-4682     FAX:    (360) 895-4925

The opinions expressed herein are my own and not that of Kitsap
County.

(to reply to this message, remove the dash from my username. I
apologize in advance for the inconvenience.)