dzm
dzm

Reputation: 23574

Rename target files while using zip command

I'm using the zip command to zip files, such as zip -r - file1 file2 file3

We want to rename these files however, before they are zipped.

Does anyone know if there's a way to pipe this or somehow rename the files that are being added to the zip?

Upvotes: 6

Views: 6576

Answers (2)

GC 13
GC 13

Reputation: 256

Providing customized name to the outcoming xyz.zip folder is possible. but renaming the input file should be done before it takes input for processing ZIP action.

Following are the possible ways that will create archivefile1.zip file

zip -r archivefile1 .
zip -r archivefile1 .* *
zip -r archivefile1 .*

Upvotes: 1

Command zipnote:

echo -e "@ myOldFileName.txt\n@=myNewFileName.txt" | zipnote -w myzip.zip

Upvotes: 5

Related Questions