击:递归删除文件 [英] Bash: Recursively remove files

查看:139
本文介绍了击:递归删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有任何人有一个解决方案,以消除这些讨厌._和.DS_Store文件从Mac文件移动到Linux服务器?

Does anyone have a solution to remove those pesky ._ and .DS_Store files that one gets after moving files from a Mac to A Linux Server?

指定开始目录,并让他走?喜欢的/ var / www / html等/下...

specify a start directory and let it go? like /var/www/html/ down...

推荐答案

文件的目录,并使用:

find . -name ".DS_Store" -print0 | xargs -0 rm -rf
find . -name "._*" -print0 | xargs -0 rm -rf

没测试过,试戴没有xargs的第一!

Not tested, try them without the xargs first!

您会发现更换后的时期,随着目录,而不是更改到目录第一。

You could replace the period after find, with the directory, instead of changing to the directory first.

find /dir/here ...

这篇关于击:递归删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆