Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename a file inside a 7zip archive by CLI?

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

like image 515
Maciej Płocki Avatar asked Jun 23 '15 15:06

Maciej Płocki


1 Answers

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
like image 189
aquileia Avatar answered Oct 12 '22 07:10

aquileia