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



In article <nospam.News.Bob-533D6D.21124314042006@xxxxxxxxxxxxxxxx>,
Bob Harris <nospam.News.Bob@xxxxxxxxxxxxxxxxxxxxxx> wrote:

In my Pismo with OS 10.4.6 there are 25,725 directories (folders), so
that means there are roughly the same number of .DS_Store files, one in
each directory.

My iBook only has 1389 .DS_Store files out of 109239 directories
(1.27 percent)

Most of the directories on the system are System, Library, caches,
etc... where either the Finder does not see, or you as a user do
not navigate to with the Finder. Hence no .DS_Store files

Thanks for straightening me out on that.

This is why these NGs are so great, any mis-conceptions get cleared up
by others who know more about the subject.


By the way, I found out how many .DS_Store files I had by using

locate .DS_Store | wc

Great tip, I will add that to my limited Unix arsenal, thanks.



of course I also have root run the nightly
/usr/libexec/locate.updatedb
job that updates the locate database, but that is a totally
different subject.

Sounds useful, but I thought that OS X had some mechanism that
periodically updated the 'locate' database?

Of course, if the auto' update feature does not work often enough, it
could be a bit useless whenever a 'locate' search was done.



Being the newest Intel based Macs no longer run Classic, it now appears
there is no reason to hang onto those .DS_Store files, so I would not
be surprised to see Apple abandon all those many thousands of .DS_Store
files, one .DS_Store file per directory, in future versions of their OS
- - - and replace them with some centralized method of doing the minor
things that are now being done by thousands of scattered .DS_Store
files.

I disagree. Mac OS 9 (and earlier) never used .DS_Store files, so
they are a MacOSX invention (or maybe a NeXT invention, but
definitely not Classic or Mac OS 9 or earlier).

Hokay, that's what I get for listening to gossip on the net.<g>



Whenever you delete a .DS_Store file, all the above things return to
default values, i.e. the icons jump to default locations in a window,
the window size itself jumps to a default size, and Spotlight
"comments" revert to blank (no comments).

Also, _no_ "new" .DS_Store file gets created, not even if you
restart your Mac.

Not even creating a new file will cause a new .DS_Store file to be
created, provided you do not move any icons in the window, or rezize
the window.

However, _if_ you move any icons, or change the window size, or
"automatically" re-arrange all the icons in the window, _then_ a
.DS_Store file gets created again.

So you just proved my point. There are not 1000's of .DS_Store
files on the file system. Just a thousand or so. Or just over 1%
of the directories contain .DS_Store files.

On my system all the .DS_Store files take up a total of 13MB. I
have more than that tied up in some graphics files or a long .mp3
music file. And since I have a 100GB disk (93 real GB), that is
0.01% of my disk storage). And if you disk is as small as 6GB
then this would be only 0.2%. This is noise and not a major
concern for me or most people.

I found out how much space my .DS_Store files were using via:
sudo find / -name ".DS_Store" -print0 |\
xargs -0 ls -s |\
awk '{size += $1} END{print size}'

Thanks very much for all that info', especially the last part about
finding how much disk space is being used for all the DS files.

I have a book about Terminal scripting on order, hope I can understand
the Unix stuff therein, when it arrives:
Mastering Unix Shell Scripting
by author Randal K. Michael

I find your posting style very refreshing, because most Unix pros here
merely give vague broad hints on Unixy stuff, then expect me to do
_all_ the hard work of digging out the essential details.

You manage to work those details directly into your posts, which has
the benefit of actually showing us non-Unix types that Unix is good for
the practical everyday operation of a Mac.

If you every decide to write a Unix book, let me know so I can be the
first one standing in line for the book.


About deleting .DS_Store files
*********************
But if you want to delete them, have fun.

Naw, as I stated near the start of this thread, my interest in the DS
files is just a matter of curiousity.
.



Relevant Pages

  • Filesystem hierarchy article: "Understanding the /bin, /sbin, /usr/bin, /usr/sbin Split"
    ... If you've used UNIX or any of its derivatives, you've probably wondered why there's /bin, /sbin, /usr/bin, /usr/sbin in the file system. ... Solutions so far tend to be just layers upon layers upon layers to hide the mess of the directory structure. ... The first disk contained the operating system, while the second one contained all the user stuff. ... At some point, the operating system grew too big for the first disk, and had to spill over to the second disk. ...
    (comp.unix.sco.misc)
  • Re: Flame Bait! Windows vs: The Unices
    ... variety of OPTIONS in window managers is very nice. ... Depends on which UNIX that you are referring to. ... > at least TRY to meet todays computing needs. ... Another problem also solved by cscope. ...
    (comp.programming)
  • Re: [9fans] Guide to using Acme effectively?
    ... Uriel wrote: ... Unix text editing keyboard shortcuts that I have started to document ... console-mode Emacs or else I'll open the help window. ... makes for a decent dev environment (it's where I write most of my Unix ...
    (comp.os.plan9)
  • Re: Error checking does not work
    ... I went over all the information that you gave me and I seem to be able to operate the Cmd. ... window OK. ... When Chkdsk is working properly and I restart the PC I get a window that tells me that I can hit "any key" to stop the process. ... It is allmost like some unknown gremlin has ordered check disk to be aborted. ...
    (microsoft.public.windowsxp.newusers)
  • Re: window xp not starting from recovery cd
    ... Does it matter to what kind of computer I hook up this hard drive as a slave? ... Do I need a the file recovery software? ... window will start normaly in 30 sec or you can start safe mode, command, ... your hard disk and connect it as a slave disk to his own machine so that you ...
    (microsoft.public.windowsxp.general)