Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I delete all hidden files from a folder in the Terminal?
#1
When I copy a bunch of jpg's to a flash drive, or an SD card, I also seem to create a bunch of hidden files. These are all small files of 4096 bytes.

These devices are formatted MS-DOS (FAT32)

For example, if I copy a jpg with the filename of IMG_3232.jpg, I also end up with a hidden file called ._IMG_3232.jpg in the same directory. I can see this when I use the ls -al command at the terminal after I've navigated to the folder with the images I've copied. These hidden files cause serious problems when trying to run a slideshow on my television using the TV's SD card input, or my iDevice with the flash drive.

Is there a way to batch remove all of these hidden files (without deleting the real files) using some sort of wildcard in the terminal?



For example, if I do this command:

rm *.jpg

I will delete all jpg files in a directory.



Would something like:

rm *._

do the trick?
Reply
#2
Not sure about terminal, use to be able to search for hidden files in the finder using the option key to reveal that choice.

=wr=
Reply
#3
rm ._*.jpg  
will do what you want . You don't want to remove all hidden files in the directory , just those that are related to the image files .

If you want to remove all the FAT hidden property files in the directory , use
rm ._*
Reply
#4
In the Terminal:

dot_clean /Volumes/[name of FAT vol]
Reply
#5
TheCaber wrote:
rm ._*.jpg  
will do what you want . You don't want to remove all hidden files in the directory , just those that are related to the image files .

If you want to remove all the FAT hidden property files in the directory , use
rm ._*


Thanks!

This worked like a champ:

rm ._*.jpg


Of course I also had to run:

rm ._*.JPG

:-)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)