如何在文件夹中递归地从具有特定扩展名的原始文件中只删除扩展名



如何在文件夹中递归地从具有特定扩展名的原始文件中只删除扩展名?

例如,如果我有

/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

谢谢你的帮助。请告诉一些操作系统的命令如果命令存在(windows,ubuntu/linux(

作为命令:

ls | find *.html | for f in *.html; do mv $f $(echo $f|sed s/.html//);done

最新更新