如何在文件夹中递归地删除具有特定扩展名的原始文件的扩展名?
How to remove only extension from origin file with certain extension recursively in folder?
如何从文件夹中递归地删除具有特定扩展名的原始文件的扩展名?
例子,如果我有
/foo/bar/index.html
/foo/bar/error.html
/foo/bar/static/hi.html
/foo/bar/static/me.jpg
/foo/bar/static/you.jpg
/foo/bar/build/yep.html
而且我希望在执行一些命令后跟随
/foo/bar/index
/foo/bar/error
/foo/bar/static/hi
/foo/bar/static/me.jpg
/foo/bar/static/you.jpg
/foo/bar/build/yep
感谢您的帮助。
请告诉一些OS的命令如果命令存在(windows,ubuntu/linux)
作为命令:
ls | find *.html | for f in *.html; do mv $f $(echo $f|sed s/.html//);done
如何从文件夹中递归地删除具有特定扩展名的原始文件的扩展名?
例子,如果我有
/foo/bar/index.html
/foo/bar/error.html
/foo/bar/static/hi.html
/foo/bar/static/me.jpg
/foo/bar/static/you.jpg
/foo/bar/build/yep.html
而且我希望在执行一些命令后跟随
/foo/bar/index
/foo/bar/error
/foo/bar/static/hi
/foo/bar/static/me.jpg
/foo/bar/static/you.jpg
/foo/bar/build/yep
感谢您的帮助。 请告诉一些OS的命令如果命令存在(windows,ubuntu/linux)
作为命令:
ls | find *.html | for f in *.html; do mv $f $(echo $f|sed s/.html//);done