LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Recursively deleting ".directory" (https://www.linuxquestions.org/questions/linux-software-2/recursively-deleting-directory-306116/)

Frank616 03-25-2005 08:22 PM

Recursively deleting ".directory"
 
digiKam insists on writing a zero byte file called ".directory" in every directory it finds under its album folder. I moved digiKam's album folder around until I settled on where I wanted it, and now my disk is full of 'invisible' files called ".directory". Now, how can I recursively delete them all?

This is on a FAT32 volume, and I will need to eliminate them from two Windows 98 boxes as well (my overnight network data mirroring proliferated them before I realized they were there). DOS / Windows won't touch files starting with a period, so I'll probably have to mount those volumes over the network and kill those files from a Linux machine.

Thanks for any suggestions anyone can offer.

Frank.

bigrigdriver 03-25-2005 09:01 PM

Mount the windows partition to be searched for the .directory files.

Then, since the find command can recursively search through the directory tree, use find to specify the directory to search (for a windows partition, it would be something like /mnt/windows).

Pipe that through grep to specify the expression to select. Something like: | grep ".directory".

Then finish the one-line command with a pipe to rm to remove the files as they are found.

jschiwal 03-25-2005 11:58 PM

The find command will allow you to delete the '.directory' files as they are found.

find /mnt/windows -name '.directory' -exec rm {} \;


All times are GMT -5. The time now is 04:30 PM.