Motherboard Forums


Reply
Thread Tools Display Modes

Re: How to remove all .DS_Store files using Terminal?

 
 





















Greg Pratt
Guest
Posts: n/a

 
      04-12-2006, 05:44 PM


In article <120420060909413515%>,
Mark Conrad <> wrote:
>I want to remove every ".DS_Store" file from my boot partition _and_
>all the other partitions of my internal drive. (10.4.6 with 3
>partitions total, one bootable)
>
>Even remove all .DS_Store files in system directories.
>
>So far, I tried the following, which failed to work.
>
>From Terminal: (working as root user)
>
>cd /
>
>rm -rf .DS_Store


The -r flag will recursively descend into any *arguments* to rm(1) that
happen to be directories; .DS_Store is a normal file, so it doesn't
descend into it (which is clearly impossible). You might want to read
the man page for rm(1).

What you want to do is search for files named ".DS_Store" and perform a
particular action on them (delete them). You'll find the following
command much more useful:

$ find / -type f -name .DS_Store -exec rm {} \;

Since you're doing this from the root directory and will be stepping
through directories which you probably don't have write permission for,
you'll probably want to prefix this command with "sudo".

A couple of caveats:

1. Back up your system first before you go making such changes to your
filesystem(s).

2. Be aware that after you delete the .DS_Store files, you will lose
your window size and icon arrangement for EVERY SINGLE FOLDER ON
YOUR HARD DRIVE that isn't presently in an open window in the
Finder. Furthermore, if you had any Spotlight comments (a.k.a.
Finder comments) associated with any files whatsoever, they'll also
be blown away. That's what .DS_Store files are used for.

3. The next time you open a folder, or if you close any existing open
folders in the Finder that were open when you performed this action
in Terminal.app, .DS_Store files will be recreated for these
folders. You're not going to get rid of these files unless you stop
using the Finder.

--
Gregory Pratt
East Rutherford, NJ, USA http://www.panix.com/~gp/
"The only good spammer is a dead spammer."
PGP Key Fingerprint: DC60 FCDE 91E2 3D41 91A3 45DB B474 3D3A 3621 AAFE
 
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Viruses and the Mac FAQ David Harley Apple 0 01-21-2005 05:56 AM
Viruses and the Mac FAQ David Harley Apple 0 02-28-2004 09:08 AM
Viruses and the Mac FAQ David Harley Apple 0 12-16-2003 12:00 PM
Viruses and the Mac FAQ David Harley Apple 0 12-02-2003 11:08 AM
Viruses and the Mac FAQ David Harley Apple 0 11-17-2003 09:31 AM


All times are GMT. The time now is 01:50 AM.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43