Ibr*_*mcu 36 delete wordpress 13.10
我改变了我的 wordpress 主题。旧的在服务器上创建了这么多图像。我的新主题不需要它们,所以我想全部删除。我怎样才能做到这一点?
例如:
默认图像:12_angry_men_lone_holdout.jpg
我想删除:
12_angry_men_lone_holdout-290x166.jpg
12_angry_men_lone_holdout-700x300.jpg
12_angry_men_lone_holdout-50x50.jpg
Run Code Online (Sandbox Code Playgroud)
使用 Digitalocean,Ubuntu 13.10。
n.s*_*.st 42
使用find递归地查找和使用他们的名字“文本”删除文件:
find -type f -name '*text*' -delete
Run Code Online (Sandbox Code Playgroud)
您可能还希望在find -type f -name '*text*'此-delete之前运行(不带)以确保不会删除您不打算删除的任何文件。
事实上,您可以在搜索字符串中的任何位置放置通配符,因此-name '12_angry_men_lone_holdout-*.jpg'可能更适合您的情况。
myh*_*hau 37
如果它们在同一个文件夹中,请使用 * 通配符来实现:
rm *text*
Run Code Online (Sandbox Code Playgroud)
text文件名包含的字符串在哪里。
| 归档时间: |
|
| 查看次数: |
133770 次 |
| 最近记录: |