find . -type f -name '【xxxxxxxxxx】*.*' -print0 | xargs -0 rename -e 's/【xxxxxxxxxx】//'
https://shapeshed.com/unix-xargs/
how-to-batch-rename-files-in-a-macos-terminal
make-xargs-handle-filenames-that-contain-spaces
how-to-rename-multiple-files-using-find
xargs-command-examples
find-a-pattern-in-files-and-rename-them
-print0
True; print the full file name on the standard output, followed by a null character (instead of the newline character that -print uses). This allows file names that contain newlines or other types of white space to be correctly interpreted by programs that process the find output. This option corresponds to the -0 option of xargs.
find . -type f \( -name "*.java" -o -name "*.xml" -o -name "*.html" \)
1 条评论:
This guide is really helpful for managing files efficiently. Using LongPathTool in combination with these find and xargs commands makes handling deep or complex directory structures much easier. Clear examples and explanations are appreciated.
发表评论