Is there a way to auto “put back” everything in Trash using terminal ONLY?

Discussion in 'macOS' started by steve4900, Aug 17, 2014.

  1. steve4900 macrumors newbie

    Joined:
    Aug 17, 2014
    #1
    Hi Guys,

    I have an iMac which is not booting up... I've been told that the owners were trying to delete an application and put numerous Library files into the trash and as they did this the iMac froze and now it will not boot up (safe mode doesn't work either) the only thing I can access is the recovery mode (CMD R).

    Ive started using the Terminal through recovery mode and have accessed the trash folder with all the library files and loads of other files.

    Is there a command line that will auto put back these files into the right place as I don't know where they came from and it won't start with out them

    Other details
    The Disk utility says everything is ok.
    They don't have a back up
    Don't have the CDs

    Thanks for the help
     
  2. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #2
    I've never seen any way to do that in Terminal.

    If it command-r boots to recovery okay, just go back to that same recovery screen and click reinstall OS and the OS will download and reinstall over top of the existing install and replace the missing files. This will not delete the users personal data and should get them running again.

    The download will be about 5GB, so can take a bit.
     
  3. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #3
    There's no automated way to do this through the command line. You'll need to reinstall the OS.
     
  4. Manic Harmonic macrumors 6502

    Joined:
    Dec 4, 2011
    #4
    I would do a fresh install on a separate drive or partition, the do migration assistant from the old disk or partition, then clone that back over to the original... Your other option would be to Google the names of the files/folders in the trash, and copy or move them to their original locations with the terminal. The first option is probably easier, provided you have another drive or room for a second partition on the main drive.
     

Share This Page