Re: [fedora] dd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Xinyou,

On Sun, Sep 4, 2011 at 4:53 PM, xinyou yan <yxy.716@xxxxxxxxx> wrote:
>> I am not sure what the problem is.
>> The following works for me:
>> tar cf archive.tar first
>> tar -rf archive.tar second
> Yes it can , But tar czf tar rzf can't work
> Second :
>
> if I use
> gzip -c file1 >>  yyy.test
> How can I unpress yyy.test to file1 as file1
> I test like it
> gzip -c test1 > 1.test
> We can use
>
> gunzip -c 1.test >test1
>
> to achieve my answer .
> However :
> gzip -c test1 >> 1.test
> gzip -c test2 >> 1.test
>
> I just gunzip -c 1.test > test1 (the size of test1 now is  the sum
> test1 and test2 before)
>
> How can i use gunzip  to separate the  two file ?
> I wonder  >>  can remember there are two file ?

I think you are mixing up compression and archiving as similar things.
They should be done in a particular order:

1. to create: archive -> compress
2. to modify: decompress -> modify archive -> compress
3. restore:   decompress -> unarchive

Now (1) and (3) can be done in one step using the -z or -j option to
tar, however for (2) you need to decompress first using `gunzip' or `gzip
-d' before you can use `tar -r -f <archivefile.tar>' to modify it.

To give you an example:

$ tar -czf backup.tar.gz *.org # backup all .org files
$ tar -tzf backup.tar.gz # test if it worked
analysis.org
coding.org
fiddle.org
languages.org
meetings.org
notes.org
org-help.org
$ gunzip backup.tar.gz # decompress the compressed archive
$ tar -rf backup.tar *.org_archive # add .org_archive files
$ gzip backup.tar # compress modified archive
$ tar -tzf backup.tar.gz # test again
analysis.org
coding.org
fiddle.org
languages.org
meetings.org
notes.org
org-help.org
analysis.org_archive
meetings.org_archive
notes.org_archive
$ tar -xzf backup.tar.gz '*.org' # restore only .org files
$ ls
analysis.org  backup.tar.gz  coding.org  fiddle.org  languages.org
meetings.org  notes.org  org-help.org

In the future I would recommend try going through the manual page for
tar and gzip carefully (`man tar' and `man gzip').

I hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux