Hot answers tagged

11

There's no need for xargs. If you directly give tar the -T - option it will read the filenames from standard input. For instance: ... | tar -T - -czf xy_0_10000.tar.gz


11

you've hit xargs limit ? xargs --show-limit try : create a dummy .tgz file tar czf xy_0_10000.tar.gz /hello/world replace -czf by -Azf when xarg hit its limit, it will fork command, so command you ultimatly ran was tar czf xy_0_10000.tar.gz file1 file2 .... file666 tar czf xy_0_10000.tar.gz file667 file668 ... file1203 tar czf xy_0_10000....


9

As of August 2012, the MIME type recommended in RFC 6713 is application/gzip. According to the IANA registry, tar is not an official media type, so a GZipped tar file is officially only a compressed file. Hypothetically, if a tarball were an official media type and following conventions, its MIME type would be application/tar (file extension .tar) and its ...


5

Argument list too long is not an error specific to tar. It is an error (E2BIG) of the execve(2) syscall (given by the kernel, which has to put some limitations on execve to avoid spoiling memory). So your shell (which fork-s then execve-s the /bin/tar program) tells you that error message. It could be difficult to increase that limit (perhaps some sysconf, ...


5

Several scripts exist for converting a list of path names into tree form: my own treeify.pl treeify.rs by Loïc Damien treeify.py by Hakril All these scripts work with tar -tf … output; for example: $ tar -tf foo.tar | treeify foo ├─bar │ ├─myfile.txt │ └─yourfile.txt └─baz └─qux └─hisfile.txt Also: $ bsdtar -tf foo.zip | treeify $ ...


4

Your web server is likely sending the .tar.gz file with a content-encoding: gzip header, causing the web browser to assume a gzip layer was applied only to save bandwidth, and what you really intended to send was the .tar archive. Chrome un-gzips it on the other side like it would with any other file (.html, .js, .css, etc.) that it receives gzipped (it ...


3

This probably happens because the tar was created without the --hard-dereference and --dereference flags. Basically, the tar contains files that are hard and soft links to different places but they're not included in the tar file, so it will fail. You'll have to create the tar file again with one or both the options I mentioned. More info here.


3

You can use gpg (=GnuPG): gpg -o fileToTar.tgz.gpg --symmetric fileToTar.tgz This will prompt you for a passphrase. To decrypt the file later on, just do a: gpg fileToTar.tgz.gpg This will prompt you, again, for the passphrase.


3

The -f option needs to be last one, as the following argument specifies the archive to process. tar -zxvif backup.tar.gz Note: My answer was correct for the GNU version of tar as used on most Linux systems. As you are using BSD tar on MacOS, the -i option is not available, it's exclusive to GNU tar. You could get it by installing e.g. Homebrew or ...


2

There is also the option to specify the compression program using -I. This can include the compression level option. tar -I 'gzip -9' -cvf file.tar.gz /path/to/directory


2

I created a temp directory. And in the directory, created symbolic links to all of the files to the files to be included. Then I did tar -h -C . so that all the files (not links, but their content) are included in the archive with the desired name.


2

Traditionally, Unix systems used one program to perform one task per the Unix philosophy: tar was just a means to package multiple files into a single file, originally for tape backup (hence tar, tape archive). tar does not provide compression; the resulting uncompressed archive is typically compressed with some other program such as gzip, bzip2, or xz. In ...


2

Cp does open-read-close-open-write-close in a loop over all files. So reading from one place and writing to another occur fully interleaved. Tar|tar does reading and writing in separate processes, and in addition tar uses multiple threads to read (and write) several files 'at once', effectively allowing the disk controller to fetch, buffer and store many ...


2

You got it almost right, just run the tar on the remote host instead of locally, the command should look something like this: ssh remote_host tar cvfz - -T /directory/allfiles.txt > remote_files.tar.gz


2

First, not all programs ever written are packaged as rpm. Secondly, if by install from rpm you mean tools such as yum or zypper and by install by tarball you mean downloading a tarball source code from a project's website and building and installing it manually there may be several reasons why someone would prefer to go with a tarball instead of a prepared ...


2

at first sight (w/o date of file/directory) : find data -type d -exec echo mkdir -p {} \; | ( cd tmp7 ; bash ) find data -type f -exec echo touch {} \; | ( cd tmp7 ; bash ) where data is your source tmp7 your destination


2

you could do this: tar -C `mktemp -d` -xvf foo.tar Which extracts foo.tar into a temp directory but that is only technically correct because it doesn't tell you where the directory is. a two line approach would be: NEW_TMP_DIR=`mktemp -d` tar -C $NEW_TMP_DIR -xvf foo.tar and if you want to chain them you can with && to make it one liner and ...


2

You were looking in the wrong place for documentation. Always check the official sources first. For ffmpeg, the packages provided by distributions are always more or less outdated. Basically, you have two options: Install a static build, which is already compiled and ready for use. Go to the download page and select the "Linux Static Builds", not the ...


2

Yes. Easiest way (assuming no more than about 2000 files) is to use a wildcard: gunzip *.gz If there are more files, or if you also have them in subdirs, try this: find /path/to/files/ -name "*.gz" -exec gunzip {} + The reason for that is that argument lists have limited space; gunzip *.gz will fail if you try it with too many files at once. Find ...


1

Sometimes you want a different version than is available in the package manager. From a security perspective, you might not trust a package manager, and so want to download the tarball, review the source, and install once you are confident it is not compromised. Or you may want to edit the source to make the application behave differently, for example to ...


1

The image link is below the link for tar file in openelec download page. Just look for "Disk image". The link is also pasted below for your convenience :) http://releases.openelec.tv/OpenELEC-RPi.arm-5.0.8.img.gz This can be written into sd card using instructions from http://wiki.openelec.tv/index.php/HOW-TO:Installing_OpenELEC/Writing_The_Disk_Image#tab=...


1

Try using the -C option in Tar: tar -C /usr/local/bin/ -cvzf foo.tar.gz data


1

Yes, it is possible, and simple. As Hastur mentioned, the command you want is: tar --exclude='*.pyc' czvf testdir.tgz testdir And I want to add that if you have a question about any terminal command you are using on Linux (or Mac OS X for that matter), the best place to start is with the official documentation. Type man tar and you will pull it up. You ...


1

I do not think it's possible via command line, but I was able to read an archive tarred (is that a word?) directly to device (I used your tar command to write to USB) using 7a File Manager (GUI). You'd need to use special prefix to address device directly: The "\\.\" prefix will access the Win32 device namespace instead of the Win32 file namespace. This ...


1

You can do this to prevent tar from seeing a parameter beginning with - tar cf foo ./-i_jkhv34 (assuming you want the archive to be named foo). Backslash (\) will only be seen by the shell, not by tar. Some implementations of tar provide other ways to specify filenames (there is no standard for tar, by the way). For instance, GNU tar provides a -T ...


1

If you have enough space on your local disk and your goal is to minimise the amount of date sent over the network maybe it is enough to enable the compression with scp or rsync : scp -avrC remotehost:/path/to/files/file1 /files/file2 ... local/destination/path Of course you can do a little script to loop over each file and do an scp compressed transfer, ...


1

Yes, any archive can (potentially) contain malicious code. To build off of what 'usr-local-ΕΨΗΕΛΩΝ' said, not only can a malicious executable lurk inside of the archive, but the archive structure can be set up such that the archive is the virus (sort-of). When the archive contains a malicious executable, one usually has to enable the executable bit on ...


1

install lrzip as described already sudo apt-get install lrzip then you can use the inbuilt lrzip decompression and untarring wrapper: lrzuntar Debian_GNU_Linux_8_jessie_sage-6.8-x86_64-Linux.tar.lrz which will extract the files in the tar file into a directory called Debian_GNU_Linux_8_jessie_sage-6.8-x86_64-Linux


1

You could do $ lrunzip Debian_GNU_Linux_8_jessie_sage-6.8-x86_64-Linux.tar.lrz for which you might have to install lrzip first, by doing $ sudo apt-get install lrzip After running lrunzip as above, you get a .tar archive, which you still need to untar to a directory, for example by running $ tar xvf Debian_GNU_Linux_8_jessie_sage-6.8-x86_64-Linux.tar ...



Only top voted, non community-wiki answers of a minimum length are eligible