使用管道从 Ubuntu 笔记本电脑中删除所有出现的 Thumbs.db 文件
我有一台安装了 Ubuntu 10.04 的笔记本电脑。我将一些文件从一台计算机迁移到这台计算机。但有一些文件,例如 Thumbs.db 文件,我想删除其每次出现的文件。
我尝试使用
locate Thumbs.db | rm
But dis 没有成功(显然不应该)。然后我尝试使用以下内容,但不出所料,它们都没有成功:
locate thumbs.db > rm
locate thumbs.db < rm
正如这里的每个人都可能指出的那样,我在使用管道方面遇到了困难,并且想以此为例来澄清我的概念。我已经阅读了基础知识,但仍然无法直观地应用它。
I have a laptop installed with Ubuntu 10.04. I migrated some of my files from one computer to this computer. But there are some files like Thumbs.db file whose every occurrence I want to get rid of.
I tried using
locate Thumbs.db | rm
But dis didn't worked out (and clearly it should not). Then I tried using following, but quite expectedly none of them worked out :
locate thumbs.db > rm
locate thumbs.db < rm
As everyone here, might have pointed out that I am having a hard time using pipeline and want to just clear my concept using this as an example. I have read the basics but still not able to intitutively able to apply it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
find
已经具有删除功能,因此不需要管道:这表示从我当前的工作目录递归删除所有匹配
thumbs.db
的文件,无论大小写如何。find
already has a delete function, so no pipes are necessary:This says delete all files matching
thumbs.db
regardless of capitalization, recursively from my current working directory.您可能需要尝试:
或者如果您确实想使用管道,您可能需要尝试
-iname
将搜索“Thumbs.db”和“thumbs.db”。检查 man 以获取更多信息。将
/mnt/something
更改为您的路径。编辑:
我想你也可以尝试一下:
它应该与名称中包含空格的目录一起使用。
You may want try:
or if you really want use pipe you may want try
-iname
will search for 'Thumbs.db' and 'thumbs.db'. Check man for more info.change
/mnt/something
for your path.Edit:
I think you can also try it:
It should work with dirs what contain space in name etc.