Accidentally deleted everything from a directory on my Macbook using terminalWhat tools exist to recover a file I clobbered using cpp in terminal?How can I do a fresh install of OSX Mountain Lion onto my SSD for my Macbook?Restore Mac from Time Machine Backup via TerminalOSX: How to backup personal data via CLI script or commandHow can I move files or directories marked as a backup?Can Time Machine restore an erased drive?Does Time Machine back up potentially corrupted files?Cannot restore Time Machine backup to internal HDDUsing mv to rename files on terminal ended up with lost filesHow can change broken file permissions of Time Machine backups?

8086 stack segment and avoiding overflow in interrupts

Why did I lose on time with 3 pawns vs Knight. Shouldn't it be a draw?

How does a poisoned arrow combine with the spell Conjure Barrage?

If you inherit a Roth 401(k), is it taxed?

What would the United Kingdom's "optimal" Brexit deal look like?

Should I intervene when a colleague in a different department makes students run laps as part of their grade?

Why would an invisible personal shield be necessary?

Do 3/8 (37.5%) of Quadratics Have No x-Intercepts?

Just how much information should you share with a former client?

What is more environmentally friendly? An A320 or a car?

Microgravity indicators

How to store my pliers and wire cutters on my desk?

Why does the Eurostar not show youth pricing?

Why did House of Representatives need to condemn Trumps Tweets?

Boots or trail runners with reference to blisters?

Convert graph format for Mathematica graph functions

Polynomial satisfying a relation for all positive integers

Piece of chess engine, which accomplishes move generation

What is the reason for cards stating "Until end of turn, you don't lose this mana as steps and phases end"?

How to have poached eggs in "sphere form"?

What force enables us to walk? Friction or normal reaction?

90s/2000s TV show : man uses government time machine to fix national problems

Self-deportation of American Citizens from US

Is there an antonym (a complementary antonym) for "spicy" or "hot" regarding food (I DO NOT mean "seasoned", but "hot")?



Accidentally deleted everything from a directory on my Macbook using terminal


What tools exist to recover a file I clobbered using cpp in terminal?How can I do a fresh install of OSX Mountain Lion onto my SSD for my Macbook?Restore Mac from Time Machine Backup via TerminalOSX: How to backup personal data via CLI script or commandHow can I move files or directories marked as a backup?Can Time Machine restore an erased drive?Does Time Machine back up potentially corrupted files?Cannot restore Time Machine backup to internal HDDUsing mv to rename files on terminal ended up with lost filesHow can change broken file permissions of Time Machine backups?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I accidentally did a rm -rf * on a wrong directory on my macbook terminal. It appears that the rm command operates just like on a Linux system, where it's irreversible.



But I did back up my Mac to my external HDD so I can restore it using Time Machine, but I wanted to see if anyone knows of another, preferably quicker way to get all of my files back in the directory I used the above command in?










share|improve this question






























    3















    I accidentally did a rm -rf * on a wrong directory on my macbook terminal. It appears that the rm command operates just like on a Linux system, where it's irreversible.



    But I did back up my Mac to my external HDD so I can restore it using Time Machine, but I wanted to see if anyone knows of another, preferably quicker way to get all of my files back in the directory I used the above command in?










    share|improve this question


























      3












      3








      3








      I accidentally did a rm -rf * on a wrong directory on my macbook terminal. It appears that the rm command operates just like on a Linux system, where it's irreversible.



      But I did back up my Mac to my external HDD so I can restore it using Time Machine, but I wanted to see if anyone knows of another, preferably quicker way to get all of my files back in the directory I used the above command in?










      share|improve this question














      I accidentally did a rm -rf * on a wrong directory on my macbook terminal. It appears that the rm command operates just like on a Linux system, where it's irreversible.



      But I did back up my Mac to my external HDD so I can restore it using Time Machine, but I wanted to see if anyone knows of another, preferably quicker way to get all of my files back in the directory I used the above command in?







      macbook terminal time-machine trash






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 9 hours ago









      IamanonIamanon

      373 bronze badges




      373 bronze badges























          3 Answers
          3






          active

          oldest

          votes


















          7














          Restoring from backup is the way to go here, there is no magic „undo rm -rf“ command.






          share|improve this answer
































            4














            You do not need to restore your whole machine. You need to restore only one folder. Time machine is much faster than I assume. Seems like a big deal to me since I've been trained never to relay on backup.



            Just crank up Time Machine and copy the folder, in which you deleted all the content, back to where ever you had it. I had to go back a level in TimeMachine's display before the restore button became active.



            Of course, you you could be missing the absolute latest changes.



            enter image description here



            Pick what folder you want to restore. I picked my numbers folder.



            enter image description here



            result:
            enter image description here



            PS:
            I do not recommend deleting directories from the terminal. It's safer from finder. I've added the following alias to my bash profile.



            alias cp='cp -i'
            alias mv='mv -i'
            alias rm='rm -i'


            Run these as see how they go. Once you have establish they are delete the correct files, use control + c to quit. Then repeat with a backslash in front of the command to nix the alias version of the command. Aliases do not hold with sudo.






            share|improve this answer


































              1














              Copying from a backup is much more efficient than anything. If you want to take the hard route, stop using your operating system immediately and look into using testdisk on it from an external OS installation.



              For backing up from your time machine drive do the following:



              Plug in your time machine backup, and then open up terminal.



              Open up two finder windows. In one window, navigate to the deleted directory on your local hard drive. In the other finder window, navigate to the same directory (your backup copy) in the time machine hard drive.



              Go back to terminal and type:cp -R
              then go to your time machine directory folder that is your backup copy, and drag it to the terminal. For example if you did rm -rf* ~/Downloads/ or rm -rf* /Users/Myhomefolder/Downloads/



              your terminal should now look like this:



              $`cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads`


              then enter /* and a space.



              Next drag go to the original deleted directory in your local drive using finder, and drag that folder to the terminal.



              your terminal should now look like this:



              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads



              then press backspace to line your curser next to the last letter in the terminal, and type /.



              The final command in your terminal should look like this:



              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads/



              If you originally deleted a protected folder in root, the be sure to enter $sudo in the terminal before entering the command.



              Be sure you have the correct command and directories, then press enter to run the command. The back up will now copy to your hard drive.






              share|improve this answer

























              • Are you sure about the paths on the TimeMachine volume, shouldn’t there be a version/date in it? Also, restoring via command line copies any extended attributes added by Time Machine back onto your main drive which you should remove afterwards to avoid strange access/permission issues later on.

                – nohillside
                2 hours ago




















              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              7














              Restoring from backup is the way to go here, there is no magic „undo rm -rf“ command.






              share|improve this answer





























                7














                Restoring from backup is the way to go here, there is no magic „undo rm -rf“ command.






                share|improve this answer



























                  7












                  7








                  7







                  Restoring from backup is the way to go here, there is no magic „undo rm -rf“ command.






                  share|improve this answer













                  Restoring from backup is the way to go here, there is no magic „undo rm -rf“ command.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 9 hours ago









                  nohillsidenohillside

                  55.5k14 gold badges116 silver badges165 bronze badges




                  55.5k14 gold badges116 silver badges165 bronze badges


























                      4














                      You do not need to restore your whole machine. You need to restore only one folder. Time machine is much faster than I assume. Seems like a big deal to me since I've been trained never to relay on backup.



                      Just crank up Time Machine and copy the folder, in which you deleted all the content, back to where ever you had it. I had to go back a level in TimeMachine's display before the restore button became active.



                      Of course, you you could be missing the absolute latest changes.



                      enter image description here



                      Pick what folder you want to restore. I picked my numbers folder.



                      enter image description here



                      result:
                      enter image description here



                      PS:
                      I do not recommend deleting directories from the terminal. It's safer from finder. I've added the following alias to my bash profile.



                      alias cp='cp -i'
                      alias mv='mv -i'
                      alias rm='rm -i'


                      Run these as see how they go. Once you have establish they are delete the correct files, use control + c to quit. Then repeat with a backslash in front of the command to nix the alias version of the command. Aliases do not hold with sudo.






                      share|improve this answer































                        4














                        You do not need to restore your whole machine. You need to restore only one folder. Time machine is much faster than I assume. Seems like a big deal to me since I've been trained never to relay on backup.



                        Just crank up Time Machine and copy the folder, in which you deleted all the content, back to where ever you had it. I had to go back a level in TimeMachine's display before the restore button became active.



                        Of course, you you could be missing the absolute latest changes.



                        enter image description here



                        Pick what folder you want to restore. I picked my numbers folder.



                        enter image description here



                        result:
                        enter image description here



                        PS:
                        I do not recommend deleting directories from the terminal. It's safer from finder. I've added the following alias to my bash profile.



                        alias cp='cp -i'
                        alias mv='mv -i'
                        alias rm='rm -i'


                        Run these as see how they go. Once you have establish they are delete the correct files, use control + c to quit. Then repeat with a backslash in front of the command to nix the alias version of the command. Aliases do not hold with sudo.






                        share|improve this answer





























                          4












                          4








                          4







                          You do not need to restore your whole machine. You need to restore only one folder. Time machine is much faster than I assume. Seems like a big deal to me since I've been trained never to relay on backup.



                          Just crank up Time Machine and copy the folder, in which you deleted all the content, back to where ever you had it. I had to go back a level in TimeMachine's display before the restore button became active.



                          Of course, you you could be missing the absolute latest changes.



                          enter image description here



                          Pick what folder you want to restore. I picked my numbers folder.



                          enter image description here



                          result:
                          enter image description here



                          PS:
                          I do not recommend deleting directories from the terminal. It's safer from finder. I've added the following alias to my bash profile.



                          alias cp='cp -i'
                          alias mv='mv -i'
                          alias rm='rm -i'


                          Run these as see how they go. Once you have establish they are delete the correct files, use control + c to quit. Then repeat with a backslash in front of the command to nix the alias version of the command. Aliases do not hold with sudo.






                          share|improve this answer















                          You do not need to restore your whole machine. You need to restore only one folder. Time machine is much faster than I assume. Seems like a big deal to me since I've been trained never to relay on backup.



                          Just crank up Time Machine and copy the folder, in which you deleted all the content, back to where ever you had it. I had to go back a level in TimeMachine's display before the restore button became active.



                          Of course, you you could be missing the absolute latest changes.



                          enter image description here



                          Pick what folder you want to restore. I picked my numbers folder.



                          enter image description here



                          result:
                          enter image description here



                          PS:
                          I do not recommend deleting directories from the terminal. It's safer from finder. I've added the following alias to my bash profile.



                          alias cp='cp -i'
                          alias mv='mv -i'
                          alias rm='rm -i'


                          Run these as see how they go. Once you have establish they are delete the correct files, use control + c to quit. Then repeat with a backslash in front of the command to nix the alias version of the command. Aliases do not hold with sudo.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 8 hours ago

























                          answered 8 hours ago









                          historystamphistorystamp

                          1,2597 silver badges11 bronze badges




                          1,2597 silver badges11 bronze badges
























                              1














                              Copying from a backup is much more efficient than anything. If you want to take the hard route, stop using your operating system immediately and look into using testdisk on it from an external OS installation.



                              For backing up from your time machine drive do the following:



                              Plug in your time machine backup, and then open up terminal.



                              Open up two finder windows. In one window, navigate to the deleted directory on your local hard drive. In the other finder window, navigate to the same directory (your backup copy) in the time machine hard drive.



                              Go back to terminal and type:cp -R
                              then go to your time machine directory folder that is your backup copy, and drag it to the terminal. For example if you did rm -rf* ~/Downloads/ or rm -rf* /Users/Myhomefolder/Downloads/



                              your terminal should now look like this:



                              $`cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads`


                              then enter /* and a space.



                              Next drag go to the original deleted directory in your local drive using finder, and drag that folder to the terminal.



                              your terminal should now look like this:



                              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads



                              then press backspace to line your curser next to the last letter in the terminal, and type /.



                              The final command in your terminal should look like this:



                              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads/



                              If you originally deleted a protected folder in root, the be sure to enter $sudo in the terminal before entering the command.



                              Be sure you have the correct command and directories, then press enter to run the command. The back up will now copy to your hard drive.






                              share|improve this answer

























                              • Are you sure about the paths on the TimeMachine volume, shouldn’t there be a version/date in it? Also, restoring via command line copies any extended attributes added by Time Machine back onto your main drive which you should remove afterwards to avoid strange access/permission issues later on.

                                – nohillside
                                2 hours ago















                              1














                              Copying from a backup is much more efficient than anything. If you want to take the hard route, stop using your operating system immediately and look into using testdisk on it from an external OS installation.



                              For backing up from your time machine drive do the following:



                              Plug in your time machine backup, and then open up terminal.



                              Open up two finder windows. In one window, navigate to the deleted directory on your local hard drive. In the other finder window, navigate to the same directory (your backup copy) in the time machine hard drive.



                              Go back to terminal and type:cp -R
                              then go to your time machine directory folder that is your backup copy, and drag it to the terminal. For example if you did rm -rf* ~/Downloads/ or rm -rf* /Users/Myhomefolder/Downloads/



                              your terminal should now look like this:



                              $`cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads`


                              then enter /* and a space.



                              Next drag go to the original deleted directory in your local drive using finder, and drag that folder to the terminal.



                              your terminal should now look like this:



                              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads



                              then press backspace to line your curser next to the last letter in the terminal, and type /.



                              The final command in your terminal should look like this:



                              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads/



                              If you originally deleted a protected folder in root, the be sure to enter $sudo in the terminal before entering the command.



                              Be sure you have the correct command and directories, then press enter to run the command. The back up will now copy to your hard drive.






                              share|improve this answer

























                              • Are you sure about the paths on the TimeMachine volume, shouldn’t there be a version/date in it? Also, restoring via command line copies any extended attributes added by Time Machine back onto your main drive which you should remove afterwards to avoid strange access/permission issues later on.

                                – nohillside
                                2 hours ago













                              1












                              1








                              1







                              Copying from a backup is much more efficient than anything. If you want to take the hard route, stop using your operating system immediately and look into using testdisk on it from an external OS installation.



                              For backing up from your time machine drive do the following:



                              Plug in your time machine backup, and then open up terminal.



                              Open up two finder windows. In one window, navigate to the deleted directory on your local hard drive. In the other finder window, navigate to the same directory (your backup copy) in the time machine hard drive.



                              Go back to terminal and type:cp -R
                              then go to your time machine directory folder that is your backup copy, and drag it to the terminal. For example if you did rm -rf* ~/Downloads/ or rm -rf* /Users/Myhomefolder/Downloads/



                              your terminal should now look like this:



                              $`cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads`


                              then enter /* and a space.



                              Next drag go to the original deleted directory in your local drive using finder, and drag that folder to the terminal.



                              your terminal should now look like this:



                              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads



                              then press backspace to line your curser next to the last letter in the terminal, and type /.



                              The final command in your terminal should look like this:



                              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads/



                              If you originally deleted a protected folder in root, the be sure to enter $sudo in the terminal before entering the command.



                              Be sure you have the correct command and directories, then press enter to run the command. The back up will now copy to your hard drive.






                              share|improve this answer













                              Copying from a backup is much more efficient than anything. If you want to take the hard route, stop using your operating system immediately and look into using testdisk on it from an external OS installation.



                              For backing up from your time machine drive do the following:



                              Plug in your time machine backup, and then open up terminal.



                              Open up two finder windows. In one window, navigate to the deleted directory on your local hard drive. In the other finder window, navigate to the same directory (your backup copy) in the time machine hard drive.



                              Go back to terminal and type:cp -R
                              then go to your time machine directory folder that is your backup copy, and drag it to the terminal. For example if you did rm -rf* ~/Downloads/ or rm -rf* /Users/Myhomefolder/Downloads/



                              your terminal should now look like this:



                              $`cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads`


                              then enter /* and a space.



                              Next drag go to the original deleted directory in your local drive using finder, and drag that folder to the terminal.



                              your terminal should now look like this:



                              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads



                              then press backspace to line your curser next to the last letter in the terminal, and type /.



                              The final command in your terminal should look like this:



                              $cp -R /Volumes/TimeMachineHD/Users/Myhomefolder/Downloads/* /Users/Myhomefoldername/Downloads/



                              If you originally deleted a protected folder in root, the be sure to enter $sudo in the terminal before entering the command.



                              Be sure you have the correct command and directories, then press enter to run the command. The back up will now copy to your hard drive.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered 7 hours ago









                              DanRanDanRan

                              1798 bronze badges




                              1798 bronze badges















                              • Are you sure about the paths on the TimeMachine volume, shouldn’t there be a version/date in it? Also, restoring via command line copies any extended attributes added by Time Machine back onto your main drive which you should remove afterwards to avoid strange access/permission issues later on.

                                – nohillside
                                2 hours ago

















                              • Are you sure about the paths on the TimeMachine volume, shouldn’t there be a version/date in it? Also, restoring via command line copies any extended attributes added by Time Machine back onto your main drive which you should remove afterwards to avoid strange access/permission issues later on.

                                – nohillside
                                2 hours ago
















                              Are you sure about the paths on the TimeMachine volume, shouldn’t there be a version/date in it? Also, restoring via command line copies any extended attributes added by Time Machine back onto your main drive which you should remove afterwards to avoid strange access/permission issues later on.

                              – nohillside
                              2 hours ago





                              Are you sure about the paths on the TimeMachine volume, shouldn’t there be a version/date in it? Also, restoring via command line copies any extended attributes added by Time Machine back onto your main drive which you should remove afterwards to avoid strange access/permission issues later on.

                              – nohillside
                              2 hours ago



                              Popular posts from this blog

                              Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                              Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                              Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її