Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
50
rated 0 times [  50] [ 0]  / answers: 1 / hits: 51267  / 2 Years ago, sun, november 6, 2022, 2:30:44

I want to create zip of a folder from command-line. I can do something like

zip -r folder.zip folder. I want to give the zipped folder same name as the original folder. I can simulate this by writing a script:



#!/bin/bash
zip -r $1 $1


And then doing ./script folder.



Is it possible to do this without writing any script?


More From » bash

 Answers
6

This is how you do it straight with the shell:



zip -r folder{.zip,}

[#32493] Monday, November 7, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gliroopy

Total Points: 290
Total Questions: 115
Total Answers: 114

Location: Egypt
Member since Tue, May 3, 2022
2 Years ago
;