I uploaded my source code to SVN repository.

After committing I found many files starting with ._filename.

How can I remove all those files starting with ._filename?

I have so many subfolders and each subfolder has same problem.It would be better for me to verify that only those files which match a particular pattern are deleted. So kindly help

  • 2
    switch to git and use .gitignore :) – cat May 17 '17 at 18:02
find . -type f -name "._*" -print

This will find and display the names of all the files matching the filename globbing pattern ._* in the current directory, or in any of its subdirectories.

To remove them, change -print to -delete, or just add -delete to the end if you want to see what gets deleted.

  • 1
    You might want to add a filesize check. All those files are about 4kb. I've recently deleted a few files to many with a similar command. The ~4kb check would've saved me from that. – Martijn May 17 '17 at 10:40

The command to remove all files which starts with ._ is:

rm ._*

Before running rm command which will delete all files which match the pattern ._*, I'd suggest running the ls command to provide the list of all files which match the pattern:

ls -lsa ._*
  • I want to do that in sub directories also ..how can i achieve that..Thanks for the ls command. – Jeeva May 17 '17 at 7:41
  • @Jeeva You need to run rm with -r switch, as detailed in man rm. – Konrad May 17 '17 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.