Hi all

I just thought about backing up my home directory to a zip file so I used

zip backup-13-jul-09 .

Then I read about the argument


so I found a file called readme.txt in my home directory opened it and added "Hello World" to the bottom line then performed the

zip -u backup-13-jul-09 .

command but it didn't update the readme.txt file to include "Hello World" on the last line.

Its probably something simple but can someone help me out please?

Many thanks


I dont think your command worked:

sk@sk:~/zip$ zip backup .

zip error: Nothing to do! (backup.zip)

What I did to create the zip archive:

sk@sk:~/zip$ ls
sk@sk:~/zip$ tail -1 readme.txt
sk@sk:~/zip$ zip -r backup ../zip
  adding: ../zip/ (stored 0%)
  adding: ../zip/readme.txt (stored 0%)

Now appending text an updating:

sk@sk:~/zip$ cp backup.zip .backup.zip
sk@sk:~/zip$ tail -2 readme.txt
sk@sk:~/zip$ echo "hello, world" >> readme.txt
sk@sk:~/zip$ zip -u backup *
  adding: readme.txt (stored 0%)
sk@sk:~/zip$ diff .backup.zip backup.zip
Binary files .backup.zip and backup.zip differ
sk@sk:~/zip$ unzip backup.zip
Archive:  backup.zip
warning:  skipped "../" path component(s) in ../zip/
   creating: zip/
warning:  skipped "../" path component(s) in ../zip/readme.txt
 extracting: zip/readme.txt
replace readme.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: r
new name: readme2.txt
 extracting: readme2.txt
sk@sk:~/zip$ tail -2 readme2.txt
hello, world

I think you probably had an error when you created the archive.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.