Find all zips, and unzip in place - Unix

前端 未结 3 1946
走了就别回头了
走了就别回头了 2021-02-05 15:41

I have been trying for some time and believe I am fairly close to this, but I am fairly new to Unix so have been finding this difficult.

I have a folder, containing many

3条回答
  •  一向
    一向 (楼主)
    2021-02-05 16:27

    Use -execdir instead of -exec, which runs the command in the directory where the file is found, not the directory you run find from.

    find . -name '*.zip' -execdir unzip '{}' ';'
    

提交回复
热议问题