LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 03-25-2005, 08:22 PM   #1
Frank616
Member
 
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.

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

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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-25-2005, 11:58 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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

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


Reply



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 01:19 AM
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 06:05 AM
after deleting win partition I am getting "kernel panic" c_mitulescu Mandriva 1 02-04-2004 04:25 PM
Nautilus - "Error while deleting" ??? livewirerc Linux - General 0 10-22-2003 01:23 PM
i just finished typing "./configure" and "make" in mplayer directory... kublador Linux - General 4 02-22-2003 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:19 AM.

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