文件夹批量改名&批量解压

将2020xxxx批量修改为xxxx

1
2
3
4
5
6
7
8
9
for f in ls /root/testdata1/data/OB/2020
 do
  if test -f $f
  then
    echo $f "is file"
  else
    mv /root/testdata1/data/OB/2020/$f /root/testdata1/data/OB/2020/${f##2020}
  fi
done

win批量解压sz

@echo off
set path=D:\Program Files\7-Zip;%path%
cd L2-shenzhen\2020
for /d %%i in () do ( echo %%i
	7z e %%i*trade.7z.001 -o..\%%i\
)
pause

win批量解压OB

@echo off
set path=D:\Program Files\7-Zip;%path%
cd OB\2020
for %%i in (*.7z) do (
    echo %%i
    7z x %%i  *\SZ000725 *\SZ002475 *\SZ300185 *\SZ300059 *\SZ300433 *\SZ002241 *\SZ002549 *\SZ002797 *\SZ123048 *\SZ000100 -y
)
pause