10

I am looking for soulution how to rename files inside a 7zip archive by command line (unix).

Maciej Płocki
  • 362
  • 2
  • 7
  • 18
  • I am not sure that this is programming related, and therefore doesn't belong here – musefan Jun 23 '15 at 15:43
  • Maybe youre right musefan, but I need this solutin to build some script to batch rename some files in archived files from my backup mechanism. – Maciej Płocki Jun 23 '15 at 16:00

1 Answers1

13

The Unix tool p7zip is based on 7zip and should support the same command line options, which are documented in its help file.

To rename from the CLI, you'll need version 9.30 or above, and to rename multiple files in one go you'll need at least version 15.05 (which might not yet be ported):

http://www.7-zip.org/history.txt

The syntax to rename files inside archives is

7za rn <archive_name> <src_file_1> <dest_file_1> [ <src_file_2> <dest_file_2> ... ]

It also allows to move files around, e.g. into a subdirectory:

7za rn archive.7z old.txt new/location/new.txt
aquileia
  • 146
  • 1
  • 4