zip打包文件并添加时间戳

打包当前目录下所有文件,并添加年份时间戳

zip -q -r ${PWD##*/}$(date +%Y%m%d%H%M%S).zip * -x *.DS_Store

打包当前目录下所有文件,并添加月份时间戳

zip -q -r ${PWD##*/}$(date +%m%d%H%M%S).zip * -x *.DS_Store

 

参考文档:

https://stackoverflow.com/questions/40301363/bash-unzip-file-and-add-timestamp-in-name

https://stackoverflow.com/questions/1371261/get-current-directory-name-without-full-path-in-a-bash-script

https://blog.csdn.net/u010670689/article/details/53425111

https://www.cnblogs.com/asxe/p/9317811.html

posted @ 2021-12-08 15:37  全玉  阅读(517)  评论(0编辑  收藏  举报