[英]Rename a bunch of folders
I have a bunch of folders in the same directory 我在同一目录中有一堆文件夹
2012-12-06 Camcorder_5th_Jan_2013
2012-12-07 Camcorder_5th_Jan_2013
2012-12-16 Camcorder_5th_Jan_2013
...
I wish to drop the Camcorder_5th_Jan_2013 part and for them to look like: 我希望删除Camcorder_5th_Jan_2013部分,并使它们看起来像:
2012-12-06
2012-12-07
2012-12-16
...
I was thinking something like 我在想类似
> mv (*).Camcorder* 1
ie capture everything before Camcorder and put into group 1 and rename to this group. 即捕获摄像机之前的所有内容并放入组1,然后重命名为该组。
But I am struggling. 但是我很努力。
Any tips? 有小费吗?
Thanks 谢谢
用空字符串替换匹配\\s.+
I suggest using rename
, I am currently not in front of my Linux machine but hopefully these two links can get you somewhere: 我建议使用
rename
,目前我不在Linux机器的前面,但希望这两个链接可以使您进入某个位置:
Howto: Linux Rename Multiple Files At a Shell Prompt 如何:Linux在命令行提示符下重命名多个文件
http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html
linux batch rename directories and strip # character from name Linux批处理重命名目录并从名称中删除#字符
Update: If you have access to Gnome or the X-Environment maybe you could try something like this if the Bash syntax is giving you a headache. 更新:如果您可以访问Gnome或X环境,那么如果Bash语法让您感到头疼,则可以尝试执行类似的操作。
Métamorphose : A File -n- Folder Renamer: http://file-folder-ren.sourceforge.net Métamorphose:文件-n-文件夹重命名器: http ://file-folder-ren.sourceforge.net
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.