How do you recursively unzip archives in a directory and its subdirectories from the Unix command-line?

前端 未结 10 643
旧巷少年郎
旧巷少年郎 2020-12-04 07:15

The unzip command doesn\'t have an option for recursively unzipping archives.

If I have the following directory structure and archives:

/Moth         


        
10条回答
  •  清歌不尽
    2020-12-04 07:40

    If you're using cygwin, the syntax is slightly different for the basename command.

    find . -name "*.zip" | while read filename; do unzip -o -d "`basename "$filename" .zip`" "$filename"; done;
    

提交回复
热议问题