Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gihas

macrumors newbie
Original poster
Mar 9, 2018
5
0
I have been frustrated by the sorting in Finder, and tried to default sort, but it did not work in all folders.
I searched around on apple forums, and found that many wrote that you had to delete .DS_Store files, so I finally tried this (although I usually stay away from the terminal). Seemed like most people thought this would work. But after I did this, (almost) all of my programs disappeared, but it do not seem like the hard disk changed the storage available (as if the programs are still in there) space after it happened. When I check out the storage information, it is changing the storage used in documents and system, back and forth? A bit odd..

Anyone who has experienced this or have any tips? Most likely I must install all the programs over again, but it still seems that the programs are on the hard drive.

Here is the command:
sudo find / name .DS_Store -delete; killall finder
 
I don't know what you were reading, but I don't think deleting all .DS_Store files was what you really wanted.

That command is way too dangerous as you've discovered. You left off one dash (before "name") and that turned it into a delete-all-files command! Hope you have a good backup...
 
Wow. Like killing a gnat with a steam roller.

Chasing down/deleting every .ds_store is just a game of whack-a-mole. Every folder has one, and always will. And the Finder has quirks, so when they are regenerated (usually by any action)....the fun is back.

If you want to safely delete invisible files, you might consider making them visible. Seems much less dangerous.

Take a step back and figure out what you really need, and the best way to get there before rolling out the big guns.
 
  • Like
Reactions: TiggrToo
This was one of the places I read it:
https://howchoo.com/g/mzuxyjqyzmy/how-to-set-the-view-options-for-all-finder-windows-in-os-x

So my command missed the dash, my bad. But it didn't delete my documents and files.
Anyway, I did backup my files before I wrote in terminal, but the programs I need to reinstall

Lesson you need to learn here is how dangerous typing commands in terminal can be. One single character slip can lie between fixing a minor bug and deleting\destabilizing your entire system...
 
  • Like
Reactions: old-wiz
At this point I would restore a Time Machine snapshot. If you’re on High Sierra with APFS, you might even have a local snapshot. You have to do the latter quickly, the snapshots are deleted after 48 hours.
 
  • Like
Reactions: gihas
I simply wanted to sort all my folders by name, and it seemed like it was no easy way to do this.. Since earlier settings for one specific folder was overwriting the default overall settings. So I tried in terminal, and that was not the way I wanted to go. But no big deal, I’ve always have all mye files om Google drive; so tried this with the suspicion that it could go wrong
 
I simply wanted to sort all my folders by name, and it seemed like it was no easy way to do this.. Since earlier settings for one specific folder was overwriting the default overall settings. So I tried in terminal, and that was not the way I wanted to go. But no big deal, I’ve always have all mye files om Google drive; so tried this with the suspicion that it could go wrong

It is not just about your personal files and some apps. You executed a command with system privileges. Who knows what else you deleted.
 
It is not just about your personal files and some apps. You executed a command with system privileges. Who knows what else you deleted.
When it start deleting all files, it starts alphabetically (by file names)?
Since the tutorial explained that it only took a few minutes, I cancelled it when it didn’t stop. I didn’t see my typo though, but it was in Application-folder, is it folders before that (alphabetically) that can crash my system when deleted? I assume that it’s not a lot of folder that comes before that.

But I will check out my Time Machine when I come home later.

Anyways, thank you for your help.
 
Last edited:
With all *NIX (including OSX) the terminal commands are very powerful, but it is not a good idea to play around with them if you are not conversant with commands especially if you have no full system backup. When I was working in aa variant of *NIX about 20 years ago, we had a new Computer Science graduate who thought he had great way to improve system performance. I looked at what he wanted to do (it was not a good idea), but he insisted, so I let him screw up the system - he was very red-faced. I restored the system from backup and all was well. The system was just an engineering devlopment system so our online systems were not impacted/
 
When it start deleting all files, it starts alphabetically (by file names)?
Since the tutorial explained that it only took a few minutes, I cancelled it when it didn’t stop. I didn’t see my typo though, but it was in Application-folder, is it folders before that (alphabetically) that can crash my system when deleted? I assume that it’s not a lot of folder that comes before that.

But I will check out my Time Machine when I come home later.

Anyways, thank you for your help.

No, there's no guarantee of the order it ran - it depends on the OS implementation and if you sorted the output before piping it down the chain (which you didn't). One version of Unix I used to use in the 1990s performed in iNode number order of the folder hierarchy (took me a while to find that out :cool:).
[doublepost=1520706725][/doublepost]
With all *NIX (including OSX) the terminal commands are very powerful, but it is not a good idea to play around with them if you are not conversant with commands especially if you have no full system backup. When I was working in aa variant of *NIX about 20 years ago, we had a new Computer Science graduate who thought he had great way to improve system performance. I looked at what he wanted to do (it was not a good idea), but he insisted, so I let him screw up the system - he was very red-faced. I restored the system from backup and all was well. The system was just an engineering devlopment system so our online systems were not impacted/

Got one better. Wrote a cron job, which ran as root from root to delete old files (it was tested in a local folder where . was safe!). Wiped out files older than 2 days.

Restored the system.

Forgot to delete the front job so...2 days later...had to restore the system again! :oops:
 
  • Like
Reactions: old-wiz
No, there's no guarantee of the order it ran - it depends on the OS implementation and if you sorted the output before piping it down the chain (which you didn't). One version of Unix I used to use in the 1990s performed in iNode number order of the folder hierarchy (took me a while to find that out :cool:).
[doublep
No, there's no guarantee of the order it ran - it depends on the OS implementation and if you sorted the output before piping it down the chain (which you didn't). One version of Unix I used to use in the 1990s performed in iNode number order of the folder hierarchy (took me a while to find that out :cool:).
[doublepost=1520706725][/doublepost]

Got one better. Wrote a cron job, which ran as root from root to delete old files (it was tested in a local folder where . was safe!). Wiped out files older than 2 days.

Restored the system.

Forgot to delete the front job so...2 days later...had to restore the system again! :oops:


Well well, it's my sister's problem now, since it was her computer. Tried my best to help, she is not such a good sister anyway.. Good luck, Carrie!
 
No, there's no guarantee of the order it ran - it depends on the OS implementation and if you sorted the output before piping it down the chain (which you didn't). One version of Unix I used to use in the 1990s performed in iNode number order of the folder hierarchy (took me a while to find that out :cool:).
[doublepost=1520706725][/doublepost]

Got one better. Wrote a cron job, which ran as root from root to delete old files (it was tested in a local folder where . was safe!). Wiped out files older than 2 days.

Restored the system.

Forgot to delete the front job so...2 days later...had to restore the system again! :oops:


Similar experience in the late 80s with a young consultant who. in trying to do some helpful housecleaning, wrote a script to delete all files with zero length starting at the root directory! Note that all the /dev files for terminal connections have zero length. Was caught by another (more senior) consultant before turning the HP 9000 into a big block of iron.
 
  • Like
Reactions: TiggrToo
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.