Tag Info

New answers tagged

1

There is no guarantee that there is a subdirectory in the tar file, or that there is only one. I have a special script to extract tar archives that first creates a temporary directory, extracts the file in that directory, and then counts the number of entries in that directory and if it is only one directory/file it moves it up from the temporary ...


1

tar -tvf tarfile.tar gives you the whole list of files in tarfile.tar tar -xvf tarfile.tar fileToRestore This command restores the fileToRestore To untar multiple files, but not all of them you can: You put all file list from tarfile.tar into tar.txt tar -tvf tarfile.tar > tar.txt Now tar.txt has the whole list of files in tarfile.tar and you ...


0

You don't give much information here, so this is a guess but I assume that you don't have a directory in your tgz file in the first place. tar doesn't create a directory if none is present in the archive file. You can create a directory yourself and then let tar extract into that by adding -C /target/directory but remember: tar doesn't create the directory ...


1

First of all, the guide is boggus. tar xfj https://dl.bitmask.net/client/GNU/Linux/Bitmask-GNU/Linux64-latest.tar.bz2 will never work. You see that the 32-bit instructions are somewhat correct as they don't use a scheme. Second, that file doesn't even exist in the server: ➜ ~ wget https://dl.bitmask.net/client/GNU/Linux/Bitmask-GNU/Linux64-latest.tar.bz2 ...


0

First is find: To find all tar files in a directory you will need find $directory -iname "*.tar" Note: -iname is a gnu extension, so if you are not using gnu you will have to do -name *.tar -o -name *.TAR this is almost equivalent. Now to add your working tar command: find $directory -iname "*.tar" -print0 | xargs -0 --max-args=1 tar xf This will extract ...


2

This might help find ./ -name '*.tar' -exec sh -c 'dir=$(dirname "$0"); tar -xvf "${0}" -C "${dir}"; done' {} \; From man page of tar -C, --directory DIR change to directory DIR


1

just to precise, creation tar cvzf example2.tgz example1 extraction tar xvzf example2.tgz where c : create x : extract v : verbose z : compress f : target tar/tar gz file argument, sould be placed last the trick is that f is expecting a file, which should be next.


5

The command you're showing in your first line (tar -cvfz example2.tgz example1) doesn't work and it should not output any file example2.tgz. Didn't you get an error? Perhaps the file example2.tgz existed already? Check if you have a file called z in that folder - that's where the tgz has been saved to, because: The -f parameter specifies the file which must ...


2

If you have a moderately large website, unless it has a lot of user-contributed content, it has probably has a couple of megabytes of HTML, CSS, JavaScript, PHP, etc. This stuff can typically be compressed pretty well. Which means that the images are something like 99% of the tarball. Images are already compressed, so compressing them again won't reduce the ...


3

This is a question of lossless data compression, namely the one of its limitations. Usually the more random the data is the harder it is to compress, because compression basically is finding patterns and representing them with less information (you may think of it as of being able to predict following words from the beginning of a sentence). Thus a noise ...


2

From info tar: The checkpoint facility is enabled using the following option: --checkpoint[=N]: Schedule checkpoints before writing or reading each Nth record. The default value for N is 10. So the default value for N is 10 records. But what is a record anyway? In truth, the meaning of record above is not easily discerned. There are no hints or ...


0

Some info about how recovery works can be found at Recovering a damaged .gz file There also is a tool that helps you doing this: gzip Recovery Toolkit aka gzrecover


5

So recently I wanted to do this with tar. Some investigation indicated to me that it was more than a little nonsensical that I couldn't. I did come up with this weird split --filter="cat >file; tar -r ..." thing, but, well, it was terribly slow. And the more I read about tar the more nonsensical it seemed. You see, tar is just a concatenated list of ...


4

You problem puzzled me for some time, and I think I have found a solution that would work. I think you can achieve what you want with 7z using the -si{NAME} flag. You will be able to adapt to your need. 7z a test.7z -siSDA2.txt < /dev/sda1 7z a test.7z -siSDA2.txt < /dev/sda2 7z l test.7z 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov ...



Top 50 recent answers are included