以下命令找到了以下目录.
$ find tmp/ -name "date=*" -type d
tmp/year=2022/month=05/date=27
tmp/year=2022/month=05/date=21
tmp/year=2022/month=05/date=29
tmp/year=2022/month=05/date=24
tmp/year=2022/month=05/date=31
tmp/year=2022/month=06/date=01
tmp/year=2022/month=06/date=02
我需要通过将date=
替换为day=
来重命名目录.
find tmp/ -name "date=*" -type d -exec rename s/date=/day=/g "{}" +;
但是,该命令不会重命名目录?
我需要用Python实现它.