Tag Info

Hot answers tagged


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, ...


You can ask tar to run an action every few blocks at what they call checkpoints. This action can test if the wanted file has been extracted and if so kill the tar. I tried it using a tar file and it seems to work ok. Here's my example script to do my test, tarring /usr/bin and extracting usr/bin/bash into /tmp/usr/bin/bash. The default --checkpoint is 10 ...


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


Just adding another use-case here. I had a large directory structure on a system nearly out of disk space and wanted to end up with a tar.gz file of the directory structure on another machine with lots of space. tar -czf - big-dir | ssh user@host 'cat > /path/to/big-dir.tar.gz' This saves on network overhead and means you don't have to tar on the other ...


Tar works the other way around when using -T. It archives the files including full path. If you don't want the path, strip it on extracting, e. g. Create Tarball tar -C /var/www/website html -cvzf html.tgz -T /tmp/htmllist.txt Extract Tarball tar -xvf html.tgz --strip-path=3 This strips 3 components from the output path, i. e. /var/www/website.

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