Missing all my applications after terminal-command

Discussion in 'Mac Basics and Help' started by gihas, Mar 10, 2018.

  1. gihas macrumors newbie

    Joined:
    Mar 9, 2018
    #1
    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
     
  2. MC6800 macrumors 6502

    Joined:
    Jun 29, 2016
    #2
    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...
     
  3. b0fh666 macrumors 6502a

    b0fh666

    Joined:
    Oct 12, 2012
    Location:
    south
  4. gihas thread starter macrumors newbie

    Joined:
    Mar 9, 2018
    #4
  5. hobowankenobi macrumors 6502a

    Joined:
    Aug 27, 2015
    Location:
    on the land line mr. smith.
    #5
    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.
     
  6. TiggrToo macrumors 6502a

    TiggrToo

    Joined:
    Aug 24, 2017
    Location:
    Out there...way out there
    #6
    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...
     
  7. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #7
    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.
     
  8. gihas thread starter macrumors newbie

    Joined:
    Mar 9, 2018
    #8
    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
     
  9. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #9
    It is not just about your personal files and some apps. You executed a command with system privileges. Who knows what else you deleted.
     
  10. gihas, Mar 10, 2018
    Last edited: Mar 10, 2018

    gihas thread starter macrumors newbie

    Joined:
    Mar 9, 2018
    #10
    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.
     
  11. old-wiz macrumors G3

    Joined:
    Mar 26, 2008
    Location:
    West Suburban Boston Ma
    #11
    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/
     
  12. TiggrToo macrumors 6502a

    TiggrToo

    Joined:
    Aug 24, 2017
    Location:
    Out there...way out there
    #12
    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:).
    --- Post Merged, Mar 10, 2018 ---
    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:
     
  13. gihas thread starter macrumors newbie

    Joined:
    Mar 9, 2018
    #13
     
  14. jaduff46 macrumors 6502

    jaduff46

    Joined:
    Mar 3, 2010
    Location:
    Second star on the right....
    #14

    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.
     

Share This Page

13 March 10, 2018