Skip to content

Instantly share code, notes, and snippets.

View daudo's full-sized avatar

daudo daudo

View GitHub Profile
% tar xjf the_bad_bad_backup.tar.bz2
bzip2: Data integrity error when decompressing.
Input file = (stdin), output file = (stdout)
It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.
You can use the `bzip2recover' program to *attempt* to recover
data from undamaged sections of corrupted files.
% bzip2recover the_bad_bad_backup.tar.bz2
% bunzip2 rec*bz2
% tar xf rec00200
tar: this doesn't look like a »tar«-archive
tar: jumping to the next header
tar: error upon exit caused by previous errors
% cat rec00[2-4][0-9][0-9] > good_tail.tar
% perl find_tar_headers.pl good_tail.tar
good_tail.tar:17185:top/secret/warp_reactor.so:157106
good_tail.tar:75041:top/secret/kernel_injectors.so:153125
good_tail.tar:130849:top/secret/dampening_fields.so:145746
good_tail.tar:183585:top/secret/plasma_controls.so:157035
[...]
% tail -c +17185 good_tail.tar > extracted_tail.tar
% tar xf extracted_tail.tar
bash$ ls -l /opt/too_many_files
secret.txt
top_secret.txt
confidential.txt
public.txt
bash$ ls -l /opt/too_many_files/[!c]*
secret.txt
top_secret.txt
public.txt
bash$ ls -l --ignore="confidential.txt" /opt/too_many_files
secret.txt
top_secret.txt
public.txt