Tag Info

New answers tagged

5

You have to use a named pipe for that. First create one in the folder: mkfifo foo.pipe Then use that command: tar cvf foo.pipe ./foo >foo.out 2>foo.err & cat foo.pipe >foo.tar Notice: the cat-part, can now also be gzip or whatever, that can read from a pipe: tar cvf foo.pipe ./foo >foo.out 2>foo.err & gzip -c foo.pipe ...


5

If your system supports /dev/fd/n: tar cvf /dev/fd/3 ./foo 3>&1 > foo.out 2>foo.err | squish > foo.tar.S Which with AT&T implementations of ksh (or bash or zsh) you could write using process substitution: tar cvf >(squish > foo.tar.S) ./foo > foo.out 2>foo.err That's doing exactly the same thing except that this time, ...


0

Full recovery is not possible. Formats like .zip provide better protection and recovery options, but not full either. .tar.gz lumps all files together and then applies a compression. .zip restarts compression for each file. Therefore in .zip file a damage done to compressed block only affects the file to which this block belongs. In .tar.gz the damage will ...


2

You can pipe into a subshell and call cd in there: tar -cf - input/* | ( cd input; split --bytes=1m ) Just be careful to not call this twice, because the next time, the small files will be part of the tar archive too. It's generally not a good idea to put the archive back into the original directory. Also, your tar command is currently not compressing, ...


2

The way you are doing this, with compressing a .tar file the answer is for sure no. Whatever you use for compressing the .tar file, it doesn't know about the contents of the file, it just sees a binary stream, and whether parts of that stream are uncompressable, or minimally compressible, there is no way this is known. Don't be confused by the options for ...


1

The LZ4 algorithm could be an option. It checks if the beginning of a block is compressible and stores it uncompressed if the ratio is low. This sucessfully prevents compression of already compressed files without the need to specify their names. The overall compression ratio is lower compared to the algorithms you mention. But LZ4 is very fast, on the ...


7

I thought I could download the tarball, extract it and just run the binary, but I am not sure how to do that. You do occasionally see an app on Unix/Linux where someone has gone to the effort to make it portable (in the USB memory stick sense), but this is uncommon in the Unix world. In this specific case, RStudio is miles away from being portable on ...


0

You might try different options, for me -4e works better tar cf - wam_GG_${dir}.nc | xz -4e > wam_GG_${dir}.nc.tar.xz I tested by running: $ tar -cf - wam_GG.nc | xz -4e > wam_GG.nc.xz $ tar -cf - wam_GG.nc | xz -9e > wam_GG.nc.xz.2 So, it seems that option -4e works a little bit better than -9e. $ ll wam_GG.nc.xz* -rw-rw-r--. 1 504 504 ...


2

I would recommend to use 7z. 7Z is 7-Zip's archiving format, providing high compression ratio through powerful compression algorithms that can take benefit of parallel computing on modern multicore CPUs. To make 7z archive you need p7zip-full package. To make archive run 7z a <you_archive_name>.7z <filename>


0

Symbolic links are pointers to files in a filesystem. You may want to try to use the --dereference option with tar. This asks tar to create copies of the data that the symbolic links point to. Here is the documentation from gnu.org When `--dereference' (`-h') is used with `--create' (`-c'), tar archives the files symbolic links point to, instead of the ...


1

Adding to @Marks answer We can do it with the help of -T and --transform switches of tar command. I have the directory structure as below. |-- foo1 | |-- file1.txt | |-- file2.txt | `-- file3.txt |-- foo2 | |-- file4.txt | |-- file5.txt | `-- file6.txt |-- foo3 | |-- file7.txt | |-- file8.txt | `-- file9.txt `-- foo4 |-- file10.txt ...


1

GNU tar supports --transform=expression. In your case it would be --transform s,/,-, (except there would be no leading - which I suspect would be OK).


1

With zsh, instead of: pax -w dir Use: pax -dw dir dir/**/*(D) You can do the same with recent versions of bash -O globstar -O dotglob with: pax -dw dir/** Or recent versions of FIGNORE='@(.|..)' ksh93 -o globstar with: pax -dw dir dir/** pax is the standard command to make tar files. The output goes to stdout. Shell globs are sorted by name. If ...


3

For a GNU tar: --sort=ORDER Specify the directory sorting order when reading directories. ORDER may be one of the following: `none' No directory sorting is performed. This is the default. `name' Sort the directory entries on name. The operating system may deliver directory entries in a more or less random order, and sorting them ...


0

tar itself cannot do this, so you have to create it from a correctly ordered list. In principle you could then use tar's -T option, but there is no way to specify that the filenames in that list should be NUL terminated. So if you have any filenames with newlines in them (which is allowed) this will just break. A better option is to use cpio to generate ...



Top 50 recent answers are included