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

Re: Howto?



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


Reply to: