File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- name : Use zip to compress all subdirectories under a folder and output each directory as a zip file.
3- command : " for dir in $(ls -d {{directory}}*/); do (zip -r -q {{output}}$(basename $dir){{zip_name_endwith }}.zip $dir && echo -e \" Compressed to {{output}}$(basename $dir){{zip_name_endwith }}.zip.\" ); done"
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"
44tags :
55 - zip
66description : Use zip to compress all subdirectories under a folder and output each directory as a zip file.
77arguments :
88 - name : directory
9- description : The directory to execute.
9+ description : Optional, The directory to execute. default is current directory .
1010 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 : ' *'
1117 - name : output
12- description : The output directory of the zip file. Optional, defaults to the current directory.
18+ description : Optional, The output directory of the zip files. default is the current directory.
1319 default_value : ./
14- - name : zip_name_endwith
15- description : Endwith string of each zip file name Optional, the default time string.
20+ - name : name_with_str
21+ description : Optional, Endwith string of each zip file name. default is now time string.
1622 default_value : _$(date +%Y%m%d%H%M%S)
17- source_url : " https://linuxhint.com/what-is-zip-file /"
23+ source_url : " https://www.geeksforgeeks.org/zip-command-in-linux-with-examples /"
1824author : funnyzak
1925author_url : " https://github.com/funnyzak"
2026shells :
You can’t perform that action at this time.
0 commit comments