[Ubuntu-zh] 如何通过 rm, locate 或 find 命令批量删除文件? (文件名中包含空格)

Jianlei Zhang jlzhang1983在gmail.com
星期六 六月 1 14:11:02 UTC 2013


find . -name "*amas*ells*" -exec rm -rf {} \;

PS.不要用QQ邮箱回复本邮件列表,打断线索会让人很恼火。
On Sat, Jun 01, 2013 at 06:48:09PM +0800, Woodz wrote:
> 以关键字 Tamas Wells 为例, 尝试了 sudo locate -i *tamas*wells* | xargs rm -rf  或  sudo rm -rf `locate -i *tamas*wells*` 都不行.但 locate -i *tamas*wells* 能搜到以下文件:
> 
> 
> /mnt/else/music/杂/Tamas Wells - From Prying Plans Into The Fire.flac
> /mnt/else/music/杂/Tamas Wells - Melon Street Book Club.flac
> /mnt/else/music/杂/Tamas Wells - The Opportunity Fair.flac
> /mnt/else/music/杂/Tamas Wells - Valder Fields.flac
> /mnt/else/music/杂/Tamas Wells - Vendredi.flac
> 
> 
> 
> 应该是文件名中包含空格的缘故吧? 如何解决?
> -------------- 下一部分 --------------
> 一个HTML附件被移除...
> URL: <https://lists.ubuntu.com/archives/ubuntu-zh/attachments/20130601/5ce899e5/attachment.html>
> -- 
> ubuntu-zh mailing list
> ubuntu-zh在lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh

-- 
此致

张建雷 敬上



More information about the ubuntu-zh mailing list