FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 08-30-2011, 04:57 PM
xinyou yan
 
Default zip /gzip in bash

Hi every one ,

I was confuse to use gzip in shell.
You see below. I can use zip -gj make test.tar include the
testfile and the test1file
However , use gzip make the test_gzip.tar.gz NULL.
I see man and use gzip -c file >> tarname. to add a file to a tar file .
Can anyone tell me why?
You can let /root have two sample file testfile test1file


#!/bin/sh

anse='/root/test.tar'
anse_gzip='/root/test_gzip.tar.gz'
test='/usr/local/sbin/testfile'
test1='/usr/local/sbin/test1file'

zip -gj $anse $test
zip -gj $anse $test1

gzip -c $test >> $anse_gzip
gzip -c $test1 >> $anse_gzip

I think gzip can do what zip can do in linux .

If I just do
gzip -c testfile >> test_gzip.tar.gz

It can create the test_gzip.tar.gz file But can't include any file .



--
----------------------------------------------------------------
嘉谟之行
“昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏”
----------------------------------------------------------------
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 08-30-2011, 05:28 PM
"j.e.aneiros"
 
Default zip /gzip in bash

Hi,
gzip is a compressor, not an archiver as tar. zip is an archiver and compressor. So maybe you could use tar with the z option to compress?

Best regards, --janeiros.

On Tue, Aug 30, 2011 at 12:57 PM, xinyou yan <yxy.716@gmail.com> wrote:

Hi every one ,



* I was confuse to use gzip in shell.

* You see below. *I can use zip -gj *make test.tar include the

testfile *and the test1file

* However *, use gzip *make the test_gzip.tar.gz NULL.

* I see man and use gzip -c file >> tarname. *to add a file to a tar file .

* Can anyone tell me why?

* You can let */root have two sample file *testfile test1file





#!/bin/sh



anse='/root/test.tar'

anse_gzip='/root/test_gzip.tar.gz'

test='/usr/local/sbin/testfile'

test1='/usr/local/sbin/test1file'



zip -gj $anse $test

zip -gj $anse $test1



gzip -c $test >> $anse_gzip

gzip -c $test1 >> $anse_gzip



I think gzip can do what zip can do in linux .



If I just *do

gzip -c testfile >> test_gzip.tar.gz



It can create the test_gzip.tar.gz file But can't include any file .







--

----------------------------------------------------------------

嘉谟之行

“昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏”

----------------------------------------------------------------

--

users mailing list

users@lists.fedoraproject.org

To unsubscribe or change subscription options:

https://admin.fedoraproject.org/mailman/listinfo/users

Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



--
J. E. AneirosGNU/Linux User #190716 en http://counter.li.orgperl -e '$_=pack(c5,0105,0107,0123,0132,(1<<3)+2);y[A-Z][N-ZA-M];print;'
PK fingerprint: 5179 917E 5B34 F073 E11A *AFB3 4CB3 5301 4A80 F674


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 08-31-2011, 08:35 AM
xinyou yan
 
Default zip /gzip in bash

HI:

How can i use use gzip to compress and tar to append the other file:

here is is a testcase :


file :test1 test2

:~/testtar # tar -czf 1.tar.gz test1
:~/testtar # tar -rzf 1.tar.gz test2
tar: Cannot update compressed archives
Try `tar --help' or `tar --usage' for more information.

However tar -cf
tar -rf can work fine.

I am thinking find a way useing gzip to compress and tar then and
need to append any time .

Thank you



2011/8/31 j.e.aneiros <jesus.aneiros@gmail.com>:
> Hi,
> gzip is a compressor, not an archiver as tar. zip is an archiver and
> compressor. So maybe you could use tar with the z option to compress?
>
> Best regards, --janeiros.
> On Tue, Aug 30, 2011 at 12:57 PM, xinyou yan <yxy.716@gmail.com> wrote:
>>
>> Hi every one ,
>>
>> I was confuse to use gzip in shell.
>> You see below. I can use zip -gj make test.tar include the
>> testfile and the test1file
>> However , use gzip make the test_gzip.tar.gz NULL.
>> I see man and use gzip -c file >> tarname. to add a file to a tar file
>> .
>> Can anyone tell me why?
>> You can let /root have two sample file testfile test1file
>>
>>
>> #!/bin/sh
>>
>> anse='/root/test.tar'
>> anse_gzip='/root/test_gzip.tar.gz'
>> test='/usr/local/sbin/testfile'
>> test1='/usr/local/sbin/test1file'
>>
>> zip -gj $anse $test
>> zip -gj $anse $test1
>>
>> gzip -c $test >> $anse_gzip
>> gzip -c $test1 >> $anse_gzip
>>
>> I think gzip can do what zip can do in linux .
>>
>> If I just do
>> gzip -c testfile >> test_gzip.tar.gz
>>
>> It can create the test_gzip.tar.gz file But can't include any file .
>>
>>
>>
>> --
>> ----------------------------------------------------------------
>> 嘉谟之行
>> "昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏"
>> ----------------------------------------------------------------
>> --
>> users mailing list
>> users@lists.fedoraproject.org
>> To unsubscribe or change subscription options:
>> https://admin.fedoraproject.org/mailman/listinfo/users
>> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>
>
>
> --
> J. E. Aneiros
> GNU/Linux User #190716 en http://counter.li.org
> perl -e '$_=pack(c5,0105,0107,0123,0132,(1<<3)+2);y[A-Z][N-ZA-M];print;'
> PK fingerprint: 5179 917E 5B34 F073 E11A AFB3 4CB3 5301 4A80 F674
>
> --
> users mailing list
> users@lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>
>



--
----------------------------------------------------------------
嘉谟之行
"昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏"
----------------------------------------------------------------
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 08-31-2011, 11:28 AM
"j.e.aneiros"
 
Default zip /gzip in bash

2011/8/31 xinyou yan <yxy.716@gmail.com>

HI:



How can i use use gzip to compress and tar to append the other file:



here is is a testcase :





file :test1 test2



:~/testtar # tar -czf *1.tar.gz test1

:~/testtar # tar -rzf 1.tar.gz test2


Could you use tar czf 1.tar.gz test1 test2 ?*tar: Cannot update compressed archives


Try `tar --help' or `tar --usage' for more information.



However tar -cf

* * * * * * tar -rf *can work fine.



I am thinking find a way useing gzip to compress and tar * *then and

need to append any time .



Thank you







2011/8/31 j.e.aneiros <jesus.aneiros@gmail.com>:

> Hi,

> gzip is a compressor, not an archiver as tar. zip is an archiver and

> compressor. So maybe you could use tar with the z option to compress?

>

> Best regards, --janeiros.

> On Tue, Aug 30, 2011 at 12:57 PM, xinyou yan <yxy.716@gmail.com> wrote:

>>

>> Hi every one ,

>>

>> * I was confuse to use gzip in shell.

>> * You see below. *I can use zip -gj *make test.tar include the

>> testfile *and the test1file

>> * However *, use gzip *make the test_gzip.tar.gz NULL.

>> * I see man and use gzip -c file >> tarname. *to add a file to a tar file

>> .

>> * Can anyone tell me why?

>> * You can let */root have two sample file *testfile test1file

>>

>>

>> #!/bin/sh

>>

>> anse='/root/test.tar'

>> anse_gzip='/root/test_gzip.tar.gz'

>> test='/usr/local/sbin/testfile'

>> test1='/usr/local/sbin/test1file'

>>

>> zip -gj $anse $test

>> zip -gj $anse $test1

>>

>> gzip -c $test >> $anse_gzip

>> gzip -c $test1 >> $anse_gzip

>>

>> I think gzip can do what zip can do in linux .

>>

>> If I just *do

>> gzip -c testfile >> test_gzip.tar.gz

>>

>> It can create the test_gzip.tar.gz file But can't include any file .

>>

>>

>>

>> --

>> ----------------------------------------------------------------

>> 嘉谟之行

>> "昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏"

>> ----------------------------------------------------------------

>> --

>> users mailing list

>> users@lists.fedoraproject.org

>> To unsubscribe or change subscription options:

>> https://admin.fedoraproject.org/mailman/listinfo/users

>> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

>

>

>

> --

> J. E. Aneiros

> GNU/Linux User #190716 en http://counter.li.org

> perl -e '$_=pack(c5,0105,0107,0123,0132,(1<<3)+2);y[A-Z][N-ZA-M];print;'

> PK fingerprint: 5179 917E 5B34 F073 E11A *AFB3 4CB3 5301 4A80 F674

>

> --

> users mailing list

> users@lists.fedoraproject.org

> To unsubscribe or change subscription options:

> https://admin.fedoraproject.org/mailman/listinfo/users

> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

>

>







--

----------------------------------------------------------------

嘉谟之行

"昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏"

----------------------------------------------------------------

--

users mailing list

users@lists.fedoraproject.org

To unsubscribe or change subscription options:

https://admin.fedoraproject.org/mailman/listinfo/users

Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



--
J. E. AneirosGNU/Linux User #190716 en http://counter.li.orgperl -e '$_=pack(c5,0105,0107,0123,0132,(1<<3)+2);y[A-Z][N-ZA-M];print;'
PK fingerprint: 5179 917E 5B34 F073 E11A *AFB3 4CB3 5301 4A80 F674

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 08-31-2011, 12:38 PM
xinyou yan
 
Default zip /gzip in bash

Yes I can.
Howerver I want to append another file in another time

May be I need write a scitpt to do it .

I just wonder , whether have a easy way to do it.

在 2011年8月31日 下午7:28,j.e.aneiros <jesus.aneiros@gmail.com> 写道:
> 2011/8/31 xinyou yan <yxy.716@gmail.com>
>>
>> HI:
>>
>> How can i use use gzip to compress and tar to append the other file:
>>
>> here is is a testcase :
>>
>>
>> file :test1 test2
>>
>> :~/testtar # tar -czf 1.tar.gz test1
>> :~/testtar # tar -rzf 1.tar.gz test2
>
> Could you use tar czf 1.tar.gz test1 test2 ?
>
>>
>> tar: Cannot update compressed archives
>> Try `tar --help' or `tar --usage' for more information.
>>
>> However tar -cf
>> tar -rf can work fine.
>>
>> I am thinking find a way useing gzip to compress and tar then and
>> need to append any time .
>>
>> Thank you
>>
>>
>>
>> 2011/8/31 j.e.aneiros <jesus.aneiros@gmail.com>:
>> > Hi,
>> > gzip is a compressor, not an archiver as tar. zip is an archiver and
>> > compressor. So maybe you could use tar with the z option to compress?
>> >
>> > Best regards, --janeiros.
>> > On Tue, Aug 30, 2011 at 12:57 PM, xinyou yan <yxy.716@gmail.com> wrote:
>> >>
>> >> Hi every one ,
>> >>
>> >> I was confuse to use gzip in shell.
>> >> You see below. I can use zip -gj make test.tar include the
>> >> testfile and the test1file
>> >> However , use gzip make the test_gzip.tar.gz NULL.
>> >> I see man and use gzip -c file >> tarname. to add a file to a tar
>> >> file
>> >> .
>> >> Can anyone tell me why?
>> >> You can let /root have two sample file testfile test1file
>> >>
>> >>
>> >> #!/bin/sh
>> >>
>> >> anse='/root/test.tar'
>> >> anse_gzip='/root/test_gzip.tar.gz'
>> >> test='/usr/local/sbin/testfile'
>> >> test1='/usr/local/sbin/test1file'
>> >>
>> >> zip -gj $anse $test
>> >> zip -gj $anse $test1
>> >>
>> >> gzip -c $test >> $anse_gzip
>> >> gzip -c $test1 >> $anse_gzip
>> >>
>> >> I think gzip can do what zip can do in linux .
>> >>
>> >> If I just do
>> >> gzip -c testfile >> test_gzip.tar.gz
>> >>
>> >> It can create the test_gzip.tar.gz file But can't include any file .
>> >>
>> >>
>> >>
>> >> --
>> >> ----------------------------------------------------------------
>> >> 嘉谟之行
>> >> "昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏"
>> >> ----------------------------------------------------------------
>> >> --
>> >> users mailing list
>> >> users@lists.fedoraproject.org
>> >> To unsubscribe or change subscription options:
>> >> https://admin.fedoraproject.org/mailman/listinfo/users
>> >> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>> >
>> >
>> >
>> > --
>> > J. E. Aneiros
>> > GNU/Linux User #190716 en http://counter.li.org
>> > perl -e '$_=pack(c5,0105,0107,0123,0132,(1<<3)+2);y[A-Z][N-ZA-M];print;'
>> > PK fingerprint: 5179 917E 5B34 F073 E11A AFB3 4CB3 5301 4A80 F674
>> >
>> > --
>> > users mailing list
>> > users@lists.fedoraproject.org
>> > To unsubscribe or change subscription options:
>> > https://admin.fedoraproject.org/mailman/listinfo/users
>> > Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>> >
>> >
>>
>>
>>
>> --
>> ----------------------------------------------------------------
>> 嘉谟之行
>> "昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏"
>> ----------------------------------------------------------------
>> --
>> users mailing list
>> users@lists.fedoraproject.org
>> To unsubscribe or change subscription options:
>> https://admin.fedoraproject.org/mailman/listinfo/users
>> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>
>
>
> --
> J. E. Aneiros
> GNU/Linux User #190716 en http://counter.li.org
> perl -e '$_=pack(c5,0105,0107,0123,0132,(1<<3)+2);y[A-Z][N-ZA-M];print;'
> PK fingerprint: 5179 917E 5B34 F073 E11A AFB3 4CB3 5301 4A80 F674
>
> --
> users mailing list
> users@lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>
>



--
----------------------------------------------------------------
嘉谟之行
"昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏"
----------------------------------------------------------------
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 10:27 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org