mac(linux)或window中批量刪除maven中的lastUpdated文件

一、mac(linux)系統-創建.sh文件腳本執行(mac用.command終端也可以)

# 這裏寫你的倉庫路徑
REPOSITORY_PATH=~/Documents/tools/apache-maven-3.0.3/repository
echo 正在搜索...
find $REPOSITORY_PATH -name "*lastUpdated*" | xargs rm -fr
echo 搜索完

 

二、window系統-bat文件腳本執行

@echo off
  
rem 這裏寫你的倉庫路徑
set REPOSITORY_PATH=F:\study\apache-maven-3.0.3\repository
rem 正在搜索...
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
    del /s /q %%i
)
rem 搜索完畢
pause

轉載地址:https://www.oschina.net/code/snippet_151849_49131

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章