Sponsored Content
Top Forums UNIX for Dummies Questions & Answers compress/decompress don't take you back to the same file Post 302283151 by chebarbudo on Monday 2nd of February 2009 05:09:25 PM
Old 02-02-2009
Question compress/decompress don't take you back to the same file

Hi there,
I have a file system.tgz. I want to make changes inside this archive but before that, I want to be sure I recompress it in the exact same format.
So I did the following:
Code:
me:~# # Duplicate the archive ---------------------------------
me:~# cp system.tgz system.01.tgz
me:~# ls -l system.tgz system.01.tgz
-rw-r--r-- 1 root root 274650447 2009-02-02 22:41 system.01.tgz
-rw-r--r-- 1 root root 274650447 2009-02-02 21:32 system.tgz
me:~#
me:~# # Unzip the archive -------------------------------------
me:~# mkdir system.01/
me:~# tar -zxf system.01.tgz -C system.01/
me:~#
me:~# # Rezip the archive -------------------------------------
me:~# cd system.01/
me:~/system.01# tar -zcf system.01.tgz *
me:~/system.01# mv system.01.tgz ../
me:~/system.01# cd ..
me:~#
me:~# # Compare with previous archive -------------------------
me:~# ls -l system.tgz system.01.tgz
-rw-r--r-- 1 root root 274642873 2009-02-02 22:54 system.01.tgz
-rw-r--r-- 1 root root 274650447 2009-02-02 21:32 system.tgz

As you can see, the archive is not exactly as it was. Maybe I'm not using the same compression level? But I have no idea how to set this parameter.
Thanks for your help.
Santiago
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[help] Cant compress file

Anybody know what happened here? 162 lab2-36:~/try_direct/another> compress url.txt url.txt: -- file unchanged (8 Replies)
Discussion started by: endeavour1985
8 Replies

2. UNIX for Advanced & Expert Users

compress more than one file

hi, I need to compress a couple files in a directory.i tried using tar cvf filename1 filename2 but i am not able to open tar file. please suggest how to compress more than one file in to same file thanks in advance (2 Replies)
Discussion started by: prasee
2 Replies

3. UNIX for Dummies Questions & Answers

Decompress a .SP file

Hi to all, I'm new in this forum and I just need a quick answer from the experts out there, I have a 2761.sp file, in short a ".SP" file, it was given to me compressed, and I need to decompress it before Monday. I saw a software named Splint, but it shows an error, a DMI error message, so I dont... (3 Replies)
Discussion started by: jeco
3 Replies

4. Shell Programming and Scripting

unix script to takes the old data from a TXT file and compress them into new file

Hi, I am looking for the unix script which can takes the 2 month old data from a TXT file (there is one txt file in whiche messages are appended on daily basis) and compress them into new file.Please halp me out. (2 Replies)
Discussion started by: vpandey
2 Replies

5. UNIX for Dummies Questions & Answers

Using gunzip to decompress .zip file

Hi, I have a zipped Oralce software (linux.x64_11gR1_database.zip) and I need to unzip it. On the Linux server, I only see the gunzip utility listed: $ ls -ltr *zip* -rwxr-xr-x 3 root root 60320 Jan 15 2008 gzip -rwxr-xr-x 3 root root 60320 Jan 15 2008 gunzip Can I use the command... (1 Reply)
Discussion started by: syang68
1 Replies

6. UNIX for Dummies Questions & Answers

Issue: Compress in unix server and FTP to windows and open the compress file using Winzip

Hi All ! We have to compress a big data file in unix server and transfer it to windows and uncompress it using winzip in windows. I have used the utility ZIP like the below. zip -e <newfilename> df2_test_extract.dat but when I compress files greater than 4 gb using zip utility, it... (4 Replies)
Discussion started by: sakthifire
4 Replies

7. Shell Programming and Scripting

Decompress (with gunzip) recursively, but do not delete original gz file

Hi all, I have a folder hierarchy with many gz files in them. I would like to recursively decompress them, but keep the original files. I would also like to move all the decompressed files (these are very large HDF5 files with .CP12 extension) to another data folder. Currently I am using four... (3 Replies)
Discussion started by: gansvv
3 Replies

8. UNIX for Dummies Questions & Answers

Please, I want to decompress a file.bin "firmware"

Please, help me Please, I want to decompress a file firmware for a 2000 SAT HD Please note that I use Version ubuntu 10.04 lts file name : .................. NxpRom.bin .................. Or How do I use and is... (0 Replies)
Discussion started by: samy2012
0 Replies

9. Shell Programming and Scripting

Tar to decompress and to convert file to .dat format

tar -tvf abc.tar.gz gives me the file name abc.Is it possible to rename the file to abc.dat while decompressing using tar ? Thanks. (2 Replies)
Discussion started by: vedanta
2 Replies
XDIFF_FILE_PATCH_BINARY(3)						 1						XDIFF_FILE_PATCH_BINARY(3)

xdiff_file_patch_binary - Alias of xdiff_file_bpatch

SYNOPSIS
bool xdiff_file_patch_binary (string $file, string $patch, string $dest) DESCRIPTION
Patches a $file with a binary $patch and stores the result in a file $dest. This function accepts patches created both via xdiff_file_bdiff(3) or xdiff_file_rabdiff(3) functions or their string counterparts. Starting with version 1.5.0 this function is an alias of xdiff_file_bpatch(3). PARAMETERS
o $file - The original file. o $patch - The binary patch file. o $dest - Path of the resulting file. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 xdiff_file_patch_binary(3) example The following code applies binary diff to a file. <?php $old_version = 'archive-1.0.tgz'; $patch = 'archive.bpatch'; $result = xdiff_file_patch_binary($old_version, $patch, 'archive-1.1.tgz'); if ($result) { echo "File patched"; } else { echo "File couldn't be patched"; } ?> NOTES
Note Both files ($file and $patch) will be loaded into memory so ensure that your memory_limit is set high enough. SEE ALSO
xdiff_string_patch_binary(3). PHP Documentation Group XDIFF_FILE_PATCH_BINARY(3)
All times are GMT -4. The time now is 05:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy