everything gone!

***! I followed baltwo's instructions of resetting folder views here:

https://discussions.apple.com/thread/2402410?answerId=11391367022#11391367022


Now all my files have vanished, including backups on my external HD! 😠

Posted on Dec 26, 2011 8:49 PM

Reply
18 replies

Jan 4, 2012 4:41 AM in response to exekutive

Well,

I can't say, since I'm not one. All I know is how to contact them. And I do so on my own volunteer time.

You are always welcome to make your own Discussions Feedback post here:


https://discussions.apple.com/community/using_apple_support_communities

I'm not too keen on Onyx, if only because System cache if emptied at the wrong time can cause more corruption that is irreversable. So don't use that feature of it.

Jan 4, 2012 6:44 AM in response to exekutive

As far as I can tell, I don't understand how running that specific command *rm -rf .DS_Store /* as written can remove all files, not only on your startup disk but on your external, which that command doesn't even touch. I don't see what typo, or added or missing space, could produce that. You'd really have to completely alter and mangle it. As far as I can see, it's telling the shell to remove the .DS_Store files on the startup disk. That's it. Those DS_Store files should be recreated. Perhaps someone can enlighten me.


If the mods had to remove all the suggestions in all the forums to use

rm -rf, they'd be busy until next Christmas. But I do agree that when one offers anything with rm -rf to anyone but a relatively advanced user, especially with sudo, caveats should be included and a strong suggestion to copy/paste and not type it in. The alternative would be rm -ri, which produces a dialog box to confirm, but if one is removing numerous files, that can get old fast.

Jan 4, 2012 7:35 AM in response to Mark Jalbert

Can you please elaborate on the syntax of this command. Why does the command as written produce an error message? Why does removing the asterisks, besides removing the .DS_Store files in the current working directory (what would that be since the command includes /, the startup disk in its entirety), proceed to remove everything from the root directory? -- the command is run without sudo and I would have thought there wouldn't be privileges to go to root. How is it that the argument, as written, is directed at more than the .DS_Store files? I thought the asterisks were to ask the shell to search for all occurrences, wildcards, in this case .DS_Store. I thought the -r was to search and remove recursively through all folders, and the -f was to delete immediately.


What would have been the proper command?


I don't ask this as a challenge to you, but to sincerely understand better what you have said.

Jan 4, 2012 9:40 AM in response to WZZZ

I think the problem was the old forum formatting where "*" meant boldface or something. Then, when it showed up here in the new forums, it looked like this:

*rm -rf .DS_Store /*


I think the original poster tried that, but it didn't work. Then they tried "sudo" with it and it still didn't work. Then, they must have removed only the first "*" and kept the rest. That command succeeded in "resetting" every folder on the system.


It is a moot point. The original suggestion wasn't any good to begin with. This would have been far better:

find / -name ".DS_Store" -remove


The hosts have been asked to edit that posting, but it really isn't dangerous until someone throws in their own ingredients to the mix. Pretty much any command is dangerous once you start doing that.

Jan 4, 2012 1:40 PM in response to WZZZ

Well, I apologize for the confusion. For some reason I thought the referenced post prefaced the command with sudo. So, you asked about globbing and how the shell expands file names with an *. An * (asterick) means match zero or more occurances of any character. By itself with a command the shell will match any file. So, may be you can see that it can be a bad idea to remove files with wild card expansion.


The remove command can accept muliple arguments. So the following command removes three files named fileone, filetwo, filethree from the current working directory ->


rm fileone filetwo filethree

Even if I added the -r or R option remove would not traverse the file hierarchy looking for other files named fileone, filetwo, filethree. It would only remove the named files in the current working directory. So, recursion (-r) is only valid if an arguement is a directory. And then it would remove the directory and it's content.


Overall, there isn't a proper command. .DS_Store files should be left alone.

Jan 4, 2012 2:05 PM in response to exekutive

I just assumed baltwo was using asterisks like quotation marks, and the use of sudo is fairly common knowledge.


Since external HDs are mounted under /Volumes, they get nuked too.


I'm surprised a blunder like that was made by a level 8, #2 top contributor in that Apple forum section. Also, I can only assume that the person who blindly marked it as "helpful answer" didn't wipe out their HD. Why isn't a there a "report this post" button?


So, if all these methods can break stuff, how does one reset all folder view settings?

Jan 4, 2012 4:44 PM in response to exekutive

exekutive wrote:


I just assumed baltwo was using asterisks like quotation marks,


No. Those asterisks weren't there originally. They were part of the old Apple Discussions internal formatting codes. For whatever reason, on rare occasions, some of these codes peek out in the new Apple Support Communities forum.


and the use of sudo is fairly common knowledge.


It is commonly known to be dangerous. Using root seems to be all the rage today. I don't know why. Acting as root is always risky. That is why the terminal prompt changes for root.


I'm surprised a blunder like that was made by a level 8, #2 top contributor in that Apple forum section. Also, I can only assume that the person who blindly marked it as "helpful answer" didn't wipe out their HD. Why isn't a there a "report this post" button?


My only explanation is that perhaps the forum software corrupted the rest of the line. Perhaps there was some additional combination of <,>, or * that caused a problem. Regardless, a number of us have been trying to get that thread removed. If you were at level 2, you would have access to a "Report this post" button.


So, if all these methods can break stuff, how does one reset all folder view settings?


A command like this so do the trick:

find ~ -name ".DS_Store" -exec rm {} \; -print


This will remove any .DS_Store file in your home directory. If you wanted to do a system directory, you would have to navigate to the desired directory and use something like:

find . -name ".DS_Store" -exec rm {} \; -print


With the find command, you can always use:

find . -name ".DS_Store"


to get a preview of what files will be traversed.


Since .DS_Store files are created by the Finder, you should, in theory, own them and be able to delete them without the use of sudo.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

everything gone!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.