i'm trying to compress a folder with tar but tar claims the folder is empty.
it isn't empty there is just another folder in it and in there the files are.
should i just stick a useless file in the base folder.
Printable View
i'm trying to compress a folder with tar but tar claims the folder is empty.
it isn't empty there is just another folder in it and in there the files are.
should i just stick a useless file in the base folder.
That works perfectly for me. What tar options are you using?
works fine for me - remember as far as tar is concerned folders are just special files...
[majorwoo@woo majorwoo]$ mkdir test
[majorwoo@woo majorwoo]$ mkdir test/test
[majorwoo@woo majorwoo]$ mkdir test/test/test
[majorwoo@woo majorwoo]$ touch test/test/test/blah1
[majorwoo@woo majorwoo]$ touch test/test/test/blah2
[majorwoo@woo majorwoo]$ touch test/test/test/blah3
[majorwoo@woo majorwoo]$ tar czvf test.tar.gz test/
test/
test/test/
test/test/test/
test/test/test/blah1
test/test/test/blah2
test/test/test/blah3
[majorwoo@woo majorwoo]$
so did i (just now) but it won't list them now.
$>tar -t basemod
and it just freezes. nothing gets displayed about the file. i used ctrl-c to get out of it. the file command claims it is a tar file.
also for me it didn't display the files that it was compressing.
Yep, that's right (about the freezing when you list, that is). If you do not specify the -f option to tar, it tries to read from stdin, i.e. your terminal input. You should do either 'tar -tf basemod' or 'tar -t <basemod'.
And when compressing, it doesn't list the files it compresses without the -v option (v as in verbose).
Also, when we're at it: it won't compress the archive without the -z option. tar in itself only produces raw archives, so if you want to compress it, either specify the -z option to make tar filter the output through gzip, or run gzip yourself, either by gzipping the complete tar file manually afterwards or by piping tar's output into gzip.
You might find tar(1) and gzip(1) useful.
yeah I spose I should have left the z off and added it afterwords - force of habit ;-)