[英]How can I delete all files starting with ._ from the shell in Linux?
As the title really. 作为标题真的。 I have copied over a number of files to a Raspberry Pi from a Mac.
我已经从Mac上复制了许多文件到Raspberry Pi。 This has resulted in lots of superfluous files starting with the prefix
._
. 这导致了许多以前缀
._
开头的多余文件。 I want to delete every file in a folder that starts with ._
. 我想删除以
._
开头的文件夹中的每个文件。 How would I do this? 我该怎么做?
Try something like: 尝试类似的东西:
cd /path/to/directory; \rm -rf ._*
OR if there are recursive files with in subfolders then try: 或者,如果子文件夹中有递归文件,请尝试:
find /path/to/directory -name "._*" -type f -print0| xargs -0 \rm -rf
The EASY WAY: 简单方法:
to remove files starting with a string like : example-1.html, example-2.js, ... 删除以字符串开头的文件,例如:example-1.html,example-2.js,...
rm examp*
to remove directories starting with a string like : example-1/, example-1-1-0/, example-2/, ... 删除以字符串开头的目录,例如:example-1 /,example-1-1-0 /,example-2 /,...
rm -rf examp*
PS: PS:
-r for recursively -r用于递归
-f for force (the erasing as used for not empty directories) -f for force(用于非空目录的擦除)
that's all folks! 这是所有人!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.