Answer the question
In order to leave comments, you need to log in
Why do special characters appear in a text file after it is archived with tar gzip?
Hello! I create an archive of a text file with the command: tar -zcvf file.gz file.txt
But after I unzip it, special characters like: appear at the beginning and end of the source file:
00\00\000000644\000000766\000000766\0000000136472\0012625622023\00015132\00 0\00\00\00\
Answer the question
In order to leave comments, you need to log in
Do not archive it, but compress it. Compression utilities are used for this: gzip, bzip2, etc.
How do you unpack it?
It looks like you're using tar -czf a bit wrong, it produces a gz-compressed tar file, i.e. you get .tgz (or .tar.gz, which is the same). Accordingly, you also need to unpack it either immediately through tar -xzf or first through gunzip then through tar -xf
at the beginning and end of the source file appear special characters like:
$ tar -zcvf file.tgz file.txt
$ tar -zxvf file.tgz
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question