Linux zip command: add a file with different name [closed]

You can use zipnote which should come with the zip package. First build the zip archive with the myfile.txt file: zip archive.zip myfile.txt Then rename myfile.txt inside the zip archive with: printf “@ myfile.txt\n@=myfile2.txt\n” | zipnote -w archive.zip (Thanks to Jens for suggesting printf instead of echo -e.) A short explanation of “@ myfile.txt\n@=myfile2.txt\n”: From …

Read more

git rename many files and folders

This should do the trick: for file in $(git ls-files | grep %filenamematch% | sed -e ‘s/\(%filenamematch%[^/]*\).*/\1/’ | uniq); do git mv $file $(echo $file | sed -e ‘s/%filenamematch%/%replacement%/’); done To follow what this is doing, you’ll need to understand piping with “|” and command substitution with “$(…)”. These powerful shell constructs allow us to …

Read more