批量更改文件扩展名
Changing the extension of a file seems like something you would do often enough to know how to do it from command line. One annoying part of moving a file is repeating the file name a second time when all I want to do is change the extension. A minor annoyance but an annoyance nonetheless.
更改文件的扩展名似乎很常见,您通常会从命令行知道如何进行操作。 当我要做的就是更改扩展名时,移动文件的一个烦人的部分就是第二次重复文件名。 虽小但很烦。
I recently found that you can quickly change a file's extension with this handy shortcut:
我最近发现,您可以使用以下便捷快捷方式快速更改文件的扩展名:
# mv filename.{old,new}
mv code.{txt,js}
The braced syntax provides a way to quickly swap out the file extension without needing to repeat the file name. Sweet!
大括号语法提供了一种快速交换文件扩展名的方法,而无需重复文件名。 甜!
批量更改文件扩展名