简体   繁体   English

查找和替换服务器上的文件夹名称

[英]Find And Replace Folder Names On Server

I can't seem to find a way to do this on my dedicated server. 我似乎找不到在专用服务器上执行此操作的方法。

I've got a huge directory of folders and some of then contain 3 dashes like '---' which I need to find and replace with just one dash. 我有一个巨大的文件夹目录,其中一些包含3个破折号,例如“ ---”,我需要查找并替换为一个破折号。

Is there an easy way to do a find and replace right on my server? 有没有简单的方法可以在我的服务器上进行查找和替换? I really don't want to have to download all the folders and do it on my desktop and re-upload them. 我真的不想下载所有文件夹并在我的桌面上做并重新上传它们。

You could do something like this: 您可以执行以下操作:

find  ./  -name '*'  -exec  rename  's/---/-/g'  {}  \;

* HAS NOT BEEN TESTED * 尚未经过测试

src src

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM