我有许多目录中有一些短语(域名)的名字。需要将该短语更改为另一个(另一个域名)。如何做到这一点?下面的示例:将带有一个域名的多个目录重命名为另一个域名?
前:
$ ls /var/www
drwxr-x--- 12 apache apache 4096 Dec 16 10:28 somewhere.com
drwxr-xr-x 3 apache apache 4096 Jan 28 2011 maven.somewhere.com
drwxr-x--- 6 apache apache 4096 Feb 24 2010 mini.somewhere.com
drwxr-x--- 3 apache apache 4096 Jul 16 2010 ml.somewhere.com
...
如果输出看起来确定后
$ ls /var/www
drwxr-x--- 12 apache apache 4096 Dec 16 10:28 elsewhere.com
drwxr-xr-x 3 apache apache 4096 Jan 28 2011 maven.elsewhere.com
drwxr-x--- 6 apache apache 4096 Feb 24 2010 mini.elsewhere.com
drwxr-x--- 3 apache apache 4096 Jul 16 2010 ml.elsewhere.com
...
重复[文件夹中的壳/击快捷方式文件重命名散装(Linux)的](的http://stackoverflow.com/questions/8416990/shell-bash-shortcut-for-bulk-renaming- of-files-in-a-folderlinux) – Sorin 2012-01-31 20:02:10