New answers tagged tar
Check the file size. You're probably actually getting back HTML. Oracle does not give you the jdk download unless you check the checkbox accepting their terms. (If you look at the reponse headers, you're probably getting back Content: text/html) You can accept the terms by providing the following header: --no-cookies --header "Cookie: ...
wget http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz -O This will let you download it as a .tar.gz Look at the section of the manual for -O or --output-file=
Look into the file using less and you'll find this: <html> <head> <title>Unauthorized Request</title>
Yes, the gzip file format contains a CRC-32 checksum that can be used to detect if the archive has been corrupted. Of course, while the checksum lets gzip tell you that the archive is corrupted, it doesn't actually do anything to help you recover the data inside the archive. Thus, it's mostly useful for things like checking that an archive you just ...
The PKZip package (win/dos) comes with a program called PKZipFix that can recover files from damaged archives. I have used this utility in the past, it can recover files from moderately damaged archives that would not decompress.
tar itself does not write down a checksum for later comparsion. If you gzip the tar archive you can have that functionality. tar uses compress. If you use the -Z flag while creating the archive tar will use the compress program when reading or writing the archive. From the gzip manpage: The standard compress format was not designed to allow consistency ...
If tar finds errors when unpacking, it will print a message and exit with a non-zero exit value. This behavior is independent from the compression algorithm used after the tar file has been created. If you want to verify that the file was successfully sent to the destination over an unreliable link, then create a md5 sum of the file prior to sending and ...
If you know the exact compression options for the file (probably just defaults), you could get the actual trailing data: To get the size of the real compressed tar archive, recompress it. Using the size of the file you get - which should be smaller than the size of your original file (maybe by just one byte) get the part after the real data: tail -c ...
trailing garbage means there is extraneous data at the end of the file that is not part of the bz2 format; so bz2 can't make any sense of the additional data (hence garbage). If you want to provoke the error: $ echo Hello World | bzip2 > helloworld.bz2 $ echo Something not bzip2... >> helloworld.bz2 $ bunzip2 < helloworld.bz2 Hello World ...
No, ssh user@server sudo tar cf - / | dd of=server_clone.tar (or even worse, tar cf /everything.tar / and then copy the file off) is not likely to be an efficient way to produce a "clone" down the road, although it may be a stopgap measure if you're worried about soon-to-fail hardware or a security incident. Some problems: /proc will give a lot of ...
Any time you're unfamiliar with a command line tool, it's helpful to take a look a the man page. excerpt - man tar SYNOPSIS tar [OPTION...] [FILE]... The synopsis, which most commands will have, shows that a, b, and c would be the files/directories in this example.
It's common that, when using compression tools, the arguments after the flags and the file to be created are the files to include or add to the newly created file. In this case, a, b, and c are the files to include in your newly created file foo.tbz. The same happens when using other tools besides tar, like zip.
These are the files/directories which the tar command should include in the new created foo.tbz tarball. tar flags: -c Create a new tarball -v verbose -j use bzip2 compression -f foo.tbz Use foo.tbz as (here output) file a b c further arguments: file names/directory names which tar should include in the new tarball.
Top 50 recent answers are included