Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

批量重命名 #94

Open
vieyahn2017 opened this issue Feb 26, 2024 · 3 comments
Open

批量重命名 #94

vieyahn2017 opened this issue Feb 26, 2024 · 3 comments

Comments

@vieyahn2017
Copy link
Owner

批量重命名

@vieyahn2017
Copy link
Owner Author

find . -type f -name "20240223-*"-exec rename 's/20240223-*/20230223-*'{}\\;

@vieyahn2017
Copy link
Owner Author

vieyahn2017 commented Feb 26, 2024

powershell

Get-ChildItem -Path "your path" -Filter "20240226-*" | foreach {Rename-Item $.FullName -NewName $.Name.Replace("20240226-", "20230101-")}

Get-ChildItem -Path "your path" -Filter "20240226-*" | foreach {Rename-Item $_.FullName -NewName $_.Name.Replace("20240226-", "20230101-")}

@vieyahn2017
Copy link
Owner Author

另外搜到的rename没起作用

 find . -type f -name "20240226-*" -exec rename 's/20240226-*/20230226-*' {} \;

这边说,那是perl版本rename的用法。

批量修改文件名的任意部分
我的rename程序为Perl版本,提供man rename可以查看版本
https://www.cnblogs.com/zenglihan/p/17547099.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant