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

猜你喜欢

转载自blog.csdn.net/zhangjq520/article/details/88203273