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
For some reason, I can't get rm to recursively decend though all my directories and remove the ,DS_Store files in all of my 3 partitions.
I thought the -r option in the command would do the trick, but no joy.
Mark-
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
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
For some reason, I can't get rm to recursively decend though all my directories and remove the ,DS_Store files in all of my 3 partitions.
I thought the -r option in the command would do the trick, but no joy.
Mark-
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
Never mind, answered my own question by doing some more Googling.
Hate what I found though, because I still wish the simple way of using
"rm" would have worked.
To completely remove (temporarily) all .DS_Store files:
(working as root user)
cd /
find / -name ".DS_Store" -depth -exec rm {} \;
It works, but I do not understand a few things, specifically why {} is
used, and what is the purpose of \; at the end.
To completely remove (temporarily) all .DS_Store files:
(working as root user)
cd /
find / -name ".DS_Store" -depth -exec rm {} \;
It works, but I do not understand a few things, specifically why {} is
used, and what is the purpose of \; at the end.
Perhaps the "man" page will throw some light on these issues, but I
doubt it, as the man pages are often impossible to understand.
In article <120420060909413515%NoMailAccepted@invalid.com>, Mark Conrad <NoMailAccepted@invalid.com> 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
For some reason, I can't get rm to recursively decend though all my
directories and remove the ,DS_Store files in all of my 3 partitions.
I thought the -r option in the command would do the trick, but no joy.
Mark-
Never mind, answered my own question by doing some more Googling.
Hate what I found though, because I still wish the simple way of using
"rm" would have worked.
To completely remove (temporarily) all .DS_Store files:
(working as root user)
cd /
find / -name ".DS_Store" -depth -exec rm {} \;
It works, but I do not understand a few things, specifically why {} is
used, and what is the purpose of \; at the end.
Perhaps the "man" page will throw some light on these issues, but I
doubt it, as the man pages are often impossible to understand.
If you want to really understand this stuff, you need to find
either in depth tutorial on UNIX shell scripting, or pick up a
good used UNIX shell scripting book in a book store somewhere.
That stuff is old as hell, hasn't changed in many years, so just
about any reference should help you.
On 2006-04-12, Mark Conrad <NoMailAccepted@invalid.com> 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
That would remove .DS_Store and all subdirectories and files
in it - but it is not a directory so the -r option has no effect.
find(1) is your friend:
find / -type f -name .DS_Store -delete
It might take a while.
Also, you might want to run it without the--- Synchronet 3.18b-Win32 NewsLink 1.113
delete option first, just out of interest to see how many there
are. The "-type f" restricts it to deleting ordinary files - not
necessary unless you have created a directory called .DS_Store
somewhere with important files in.
Ian
Google "Mark Congrad"
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
For some reason, I can't get rm to recursively decend though all my directories and remove the ,DS_Store files in all of my 3 partitions.
I thought the -r option in the command would do the trick, but no joy.
Mark-
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.
In article <120420060909413515%NoMailAccepted@invalid.com>,
Mark Conrad <NoMailAccepted@invalid.com> 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.
How about a program in something quick like RealBasic. Start at the top >level, maintain a stack of folders, and nuke everything with the
filename .DS_Store. Running from root, of course.
I wrote a similar program that searches my MP3 folders and creates
random music discs for the car.
find / -name ".DS_Store" -depth -exec rm {} \;
It works, but I do not understand a few things, specifically why {} is
used, and what is the purpose of \; at the end.
For Mark, I'd suggest something like
sudo find / -exec rm -f "{}" \; -name ".DS_Store"
find / -name ".DS_Store" -depth -exec rm {} \;
It works, but I do not understand a few things, specifically why {} is used, and what is the purpose of \; at the end.
Perhaps the "man" page will throw some light on these issues, but I
doubt it, as the man pages are often impossible to understand.
If you want to really understand this stuff, you need to find
either in depth tutorial on UNIX shell scripting, or pick up a
good used UNIX shell scripting book in a book store somewhere.
That stuff is old as hell, hasn't changed in many years, so just
about any reference should help you.
Why do you want to remove them?
In article <S7Kdnbj1QpGIOaDZRVn-vg@giganews.com>, Tim Lance <lance_1012@hotmail.com> wrote:
Why do you want to remove them?
Strictly curiousity, especially because some Mac users cautioned me
that all sorts of dire things would happen if I removed (temporarily)
all of the .DS_Store files.
I am aware of most of the minor things that will happen, however I
firmly believe that no major disaster will occur.
Mark-
Thanks for responding. Many think deleting them clears up mysterious woes. IIRC, Onyx and many similar apps have deleting them as a built-in option.
In article <OP2dnXMnvZOm_KPZRVn-sw@giganews.com>, Tim Lance
<lance_1012@hotmail.com> wrote:
Thanks for responding. Many think deleting them clears up mysterious woes. >> IIRC, Onyx and many similar apps have deleting them as a built-in option.
Somewhere in all my Googling, I ran into a series of posts that claimed
the main reason that Apple included one .DS_Store files with every
directory (folder) was for backward compatability with Classic, i.e.
older OS-9 files, applications, and such.
This file in created by the Finder to keep track of folder view
options, icon positions, and other visual information about folders.
A separate .DS_Store file is created in each directory to store
information about that directory, so you'll find them appearing
all over the directory tree, in pretty much every folder you've
visited with the OS X Finder.
In article <OP2dnXMnvZOm_KPZRVn-sw@giganews.com>, Tim Lance <lance_1012@hotmail.com> wrote:
Thanks for responding. Many think deleting them clears up mysterious woes. IIRC, Onyx and many similar apps have deleting them as a built-in option.
Somewhere in all my Googling, I ran into a series of posts that claimed
the main reason that Apple included one .DS_Store files with every
directory (folder) was for backward compatability with Classic, i.e.
older OS-9 files, applications, and such.
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.
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.
Those minor thing are -
Keeping Track of:
1) icon locations in window
2) window size
3) Spotlight "comments" associated with a file
4) any menu action that causes the locations of
icons in a window to "jump" to a slightly
different location - - - for example, clicking
on the "Clean Up" entry in the "View" menu
...and likely a few other minor things
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.
Mark---- Synchronet 3.18b-Win32 NewsLink 1.113
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
By the way, I found out how many .DS_Store files I had by using
locate .DS_Store | wc
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.
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).
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}'
But if you want to delete them, have fun.
How many .DS_Store files did you find on your system?
http://www.westwind.com/reference/OS-X/invisibles.html
The entry for .DS_Store reads:
This file in created by the Finder to keep track of folder view
options, icon positions, and other visual information about folders.
A separate .DS_Store file is created in each directory to store
information about that directory, so you'll find them appearing
all over the directory tree, in pretty much every folder you've
visited with the OS X Finder.
No mention of Classic.
locate .DS_Store | wc
That yielded a 3 column printout thus:
0 0 0
...the left column being the total count of all .DS_Store files.
I do not know what columns 2 and 3 signify in that printout, because as
usual the man page for wc is inscrutable, and no amount of
experimentation on my part could ferret out any practical uses for
columns 2 and 3 in the Terminal printout.
The wc utility displays the number of lines, words, and bytes
contained in each input file (or standard input, by default)
to the standard out-put.
In article <nospam.News.Bob-533D6D.21124314042006@news.verizon.net>,
Bob Harris <nospam.News.Bob@remove.Smith-Harris.us> 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--- Synchronet 3.18b-Win32 NewsLink 1.113
*********************
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.
UNIX scripting is very powerful and flexible. A lot of its power
comes from piping the output of one command into another.
Sysop: | Gate Keeper |
---|---|
Location: | Shelby, NC |
Users: | 790 |
Nodes: | 20 (0 / 20) |
Uptime: | 41:58:43 |
Calls: | 12,115 |
Files: | 5,294 |
Messages: | 564,934 |