File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ name : Compression all subdirectories and output each directory as a zip file.
3+ command : " for dir in $(ls -d {{directory}}*/); do (zip -r {{opitons}} {{output}}$(basename $dir){{name_with_str}}.zip ${dir}{{zip_pattern}} && echo -e \" Compressed to {{output}}$(basename $dir){{name_with_str}}.zip.\" ); done"
4+ tags :
5+ - zip
6+ description : Use zip to compress all subdirectories under a folder and output each directory as a zip file.
7+ arguments :
8+ - name : directory
9+ description : Optional, The directory to execute. default is current directory.
10+ default_value : ./
11+ - name : opitons
12+ description : Optional, The options of zip command.
13+ default_value : -q
14+ - name : zip_pattern
15+ description : Optional, The pattern of match the files under each subdirectory to be compressed.
16+ default_value : ' *'
17+ - name : output
18+ description : Optional, The output directory of the zip files. default is the current directory.
19+ default_value : ./
20+ - name : name_with_str
21+ description : Optional, Endwith string of each zip file name. default is now time string.
22+ default_value : _$(date +%Y%m%d%H%M%S)
23+ source_url : " https://www.geeksforgeeks.org/zip-command-in-linux-with-examples/"
24+ author : funnyzak
25+ author_url : " https://github.com/funnyzak"
26+ shells :
27+ - Bash
You can’t perform that action at this time.
0 commit comments