Find the answer to your Linux question:
Results 1 to 5 of 5
How can I rename a file inside a zip archive without extracting and repacking the whole zip. I didn't find anything useful in the zip and 7z man pages (or ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    7

    rename file in zip archive


    How can I rename a file inside a zip archive without extracting and repacking the whole zip. I didn't find anything useful in the zip and 7z man pages (or I am just blind).

    And it needs to be doable from the command line because in need it in a script. So a gui tool won't do.

    Thanks.

  2. #2
    Just Joined!
    Join Date
    Aug 2011
    Posts
    7
    For now, I am using a package called fuse-zip to mount a zip, rename files inside the zip and unmount again. It actually works pretty well. But I would still prefer a a tool that would do it without mounting/mounting, because it's a bit cumbersome.

  3. #3
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Have you checked out zipnote? It should come with the zip package - at least it is part of the zip package in Fedora/Red Hat.

  4. #4
    Just Joined!
    Join Date
    Aug 2011
    Posts
    7
    Thanks atreyu. That was exactly what I was looking for. The usage is a bit weird but efficient. For example:
    Code:
    echo -e "@ oldfilename\n@=newfilename" | zipnote -w test.zip

  5. #5
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    and thanks for sharing an example of the squirrelly syntax - i didn't bother trying to figure it out!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •