Shell commands or script to unzip, add text file and rezip
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I have created 200 zip files for work, but I realized I forgot to add the .txt to each of them. Instead of spending hours redoing this work I'd appreciate any help.
Is there a way anyone knows using bash that will unzip, add the .txt file and rezip all 200 files? The name of the .txt file will not change just the .zip files.
Thank you.
bash ssh
New contributor
add a comment |Â
up vote
3
down vote
favorite
I have created 200 zip files for work, but I realized I forgot to add the .txt to each of them. Instead of spending hours redoing this work I'd appreciate any help.
Is there a way anyone knows using bash that will unzip, add the .txt file and rezip all 200 files? The name of the .txt file will not change just the .zip files.
Thank you.
bash ssh
New contributor
2
Imho this is about a default Ubuntu tool and thus on-topic.
â RoVo
2 hours ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I have created 200 zip files for work, but I realized I forgot to add the .txt to each of them. Instead of spending hours redoing this work I'd appreciate any help.
Is there a way anyone knows using bash that will unzip, add the .txt file and rezip all 200 files? The name of the .txt file will not change just the .zip files.
Thank you.
bash ssh
New contributor
I have created 200 zip files for work, but I realized I forgot to add the .txt to each of them. Instead of spending hours redoing this work I'd appreciate any help.
Is there a way anyone knows using bash that will unzip, add the .txt file and rezip all 200 files? The name of the .txt file will not change just the .zip files.
Thank you.
bash ssh
bash ssh
New contributor
New contributor
edited 10 mins ago
user535733
6,04522437
6,04522437
New contributor
asked 3 hours ago
TinyTim
182
182
New contributor
New contributor
2
Imho this is about a default Ubuntu tool and thus on-topic.
â RoVo
2 hours ago
add a comment |Â
2
Imho this is about a default Ubuntu tool and thus on-topic.
â RoVo
2 hours ago
2
2
Imho this is about a default Ubuntu tool and thus on-topic.
â RoVo
2 hours ago
Imho this is about a default Ubuntu tool and thus on-topic.
â RoVo
2 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
add a comment |Â
up vote
6
down vote
accepted
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
add a comment |Â
up vote
6
down vote
accepted
up vote
6
down vote
accepted
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
You don't even need to unzip the files, you can update an existing file:
zip -u existing.zip file.txt
from zip
manual:
update (-u)
Update existing entries if newer on the file system and add new files.
If the archive does not exist issue warning then create a new archive.
If you want to add a complete folder, add -r
.
To update a number of zip files, do something like this:
for z in *.zip; do
zip -u "$z" file.txt
done
See this related question on U&L.
edited 2 hours ago
answered 2 hours ago
RoVo
5,7291237
5,7291237
add a comment |Â
add a comment |Â
TinyTim is a new contributor. Be nice, and check out our Code of Conduct.
TinyTim is a new contributor. Be nice, and check out our Code of Conduct.
TinyTim is a new contributor. Be nice, and check out our Code of Conduct.
TinyTim is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1079177%2fshell-commands-or-script-to-unzip-add-text-file-and-rezip%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
Imho this is about a default Ubuntu tool and thus on-topic.
â RoVo
2 hours ago