As the title really. I have copied over a number of files to a Raspberry Pi from a Mac. 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?
You can use standard UNIX or Linux rm command to delete a file name starting with - or -- . All you have to do is instruct the rm command not to follow end of command line flags by passing double dash -- option before -foo file name.
You can do this using the Windows GUI. Enter "*. wlx" in the search box in explorer. Then after the files have been found, select them all (CTRL-A) and then delete using the delete key or context menu.
To delete multiple files at once, use the rm command followed by the file names separated by space. When using regular expansions, first list the files with the ls command so that you can see what files will be deleted before running the rm command.
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, ...
rm examp*
to remove directories starting with a string like : example-1/, example-1-1-0/, example-2/, ...
rm -rf examp*
PS:
-r for recursively
-f for force (the erasing as used for not empty directories)
that's all folks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With