Is there a command line to remove all "._foo.html" files in a directory on Unbuntu?
3 Answers
rm ./._*
more stuff since it must be at least 15 characters.
-
1Also, this resource support.apple.com/kb/ht1629 may be helpful in preventing their creation in the first place. Commented Jun 23, 2010 at 21:14
-
1
I use the following command to remove all of those annoying Apple files, but this one also does it recursively through all sub-directories, too:
# find . -iname '._*' -delete
-
3+1 I came back to my question after I realized a recursive version of this command is what I really need. Thank you for adding the answer. Commented Jun 28, 2010 at 15:14
-
1awesome. This one should be accepted as answer rather than the one above. Commented Mar 29, 2016 at 0:15
-
5
-
@ChristopherAltman, is this is really what you needed, you should accept this answer instead? Commented Aug 26, 2016 at 20:56
-
2
I use James' answer so often during webdevelopment I created my own command in
~/.bash_profile
alias rmd=rmdotfiles
rmdotfiles(){
if [ -z "$1" ]; then
local path=.
else
local path=$1
fi
find $path -iname '._*' -exec rm -rf {} \;
}
Remember to type . ~/bash_profile
after editing the file to make it available.
EDIT:
Example usage: rmd /path/to/dir
-
1Also I found that for Mac OSX Users working locally you can use a dot_clean command apple.stackexchange.com/a/136801/193609 and developer.apple.com/legacy/library/documentation/Darwin/… Commented Dec 1, 2017 at 10:25