Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-25-2005, 09:22 PM   #1
Registered: Dec 2004
Location: Canada
Distribution: Kubuntu, Fedora
Posts: 56

Rep: Reputation: 16
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.

Old 03-25-2005, 10:01 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
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.
Old 03-26-2005, 12:58 AM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
"bad interpreter : no such file or directory" when configure "flex" acer_peri Linux - Software 10 11-10-2010 02:19 AM
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 07:05 AM
after deleting win partition I am getting "kernel panic" c_mitulescu Mandriva 1 02-04-2004 05:25 PM
Nautilus - "Error while deleting" ??? livewirerc Linux - General 0 10-22-2003 02:23 PM
i just finished typing "./configure" and "make" in mplayer directory... kublador Linux - General 4 02-22-2003 04:12 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:18 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration