我想以这样的方式重命名所有以“.mp4”结尾的文件,而不是用空格来包含下划线。 例子:如何使用-exec找到并重命名所有文件
Original file -> test 1.mp4
Renamed file -> test_1.mp4
我与努力:
find . -iname "*.mp4" -exec mv {} $(echo '{}' | tr " " "_") \;
但我只得到:
mv: ‘./test 1.mp4’ and ‘./test 1.mp4’ are the same file
看来,我管不working.I将不胜感激所有的想法。
试试'找到。 -iname“* .mp4”-exec mv“{}”$(echo'{}'| tr“”“_”)\;'祝您好运。 – shellter