On 2020-01-26 02:08, Gene Heskett wrote:
On Sunday 26 January 2020 03:20:38 David Christensen wrote:
On 2020-01-26 00:03, Gene Heskett wrote:
Greetings all;
Trying to sort out how to xz compress. But xz is rejecting
directories, like it expects tars output as its input. And the
manpage is silent on redirections.
I want to compress the directory foo into foo.xz, keeping foo as
there may be further patches applied in the future.
Syntax?
Thanks.
Cheers, Gene Heskett
2020-01-26 00:11:46 dpchrist@tinkywinky ~
$ mkdir foo
2020-01-26 00:11:53 dpchrist@tinkywinky ~
$ touch foo/bar
2020-01-26 00:11:56 dpchrist@tinkywinky ~
$ touch foo/baz
2020-01-26 00:11:58 dpchrist@tinkywinky ~
$ touch foo/qux
2020-01-26 00:16:42 dpchrist@tinkywinky ~
$ tar -cJvf foo.tar.xz foo
foo/
foo/bar
foo/baz
foo/qux
2020-01-26 00:16:55 dpchrist@tinkywinky ~
$ ll -R foo*
-rw-r--r-- 1 dpchrist dpchrist 208 2020-01-26 00:16:55 foo.tar.xz
foo:
total 0
-rw-r--r-- 1 dpchrist dpchrist 0 2020-01-26 00:11:56 bar
-rw-r--r-- 1 dpchrist dpchrist 0 2020-01-26 00:11:58 baz
-rw-r--r-- 1 dpchrist dpchrist 0 2020-01-26 00:12:06 qux
2020-01-26 00:17:29 dpchrist@tinkywinky ~
$ mv foo frobnicate
2020-01-26 00:17:53 dpchrist@tinkywinky ~
$ tar -xJvf foo.tar.xz
foo/
foo/bar
foo/baz
foo/qux
2020-01-26 00:18:02 dpchrist@tinkywinky ~
$ ll -R foo frobnicate
foo:
total 0
-rw-r--r-- 1 dpchrist dpchrist 0 2020-01-26 00:11:56 bar
-rw-r--r-- 1 dpchrist dpchrist 0 2020-01-26 00:11:58 baz
-rw-r--r-- 1 dpchrist dpchrist 0 2020-01-26 00:12:06 qux
frobnicate:
total 0
-rw-r--r-- 1 dpchrist dpchrist 0 2020-01-26 00:11:56 bar
-rw-r--r-- 1 dpchrist dpchrist 0 2020-01-26 00:11:58 baz
-rw-r--r-- 1 dpchrist dpchrist 0 2020-01-26 00:12:06 qux
2020-01-26 00:18:20 dpchrist@tinkywinky ~
$ file foo.tar.xz
foo.tar.xz: XZ compressed data
2020-01-26 00:19:39 dpchrist@tinkywinky ~
$ unxz foo.tar.xz
2020-01-26 00:20:02 dpchrist@tinkywinky ~
$ ll foo.tar
-rw-r--r-- 1 dpchrist dpchrist 10240 2020-01-26 00:16:55 foo.tar
2020-01-26 00:20:09 dpchrist@tinkywinky ~
$ file foo.tar
foo.tar: POSIX tar archive (GNU)
David
I have very little idea what all that was supposed to do,
<snip>
It demonstrates how to create a directory, create files in that
directory, archive and compress the directory and files, list the
directory, files, and archive, move the directory aside, restore the
directory and files, list everything, determine the file type of the
compressed archive, decompress the archive, and determine the file type
of the decompressed archive.
You will want to learn all of the above commands, and more. This book
is a good introduction:
http://shop.oreilly.com/product/9780596002619.do
David