need help getting out of a Terminal sudo command

I did something a bit foolish and followed a suggestion by a level one user from a different Apple discussion thread, and a link posted by that user, without knowing what I was really getting into to. I know, this deserves admonishment, but at this point I just need help safely getting out of this without doing further damage to files.


Here's what happened: I connected and opened an external HD folder for the first time after having used Time Machine to back up on it, as I was planning to delete some files from that HD. Somehow the external HD sent old Time Machine files to the desktop Trash bin when I opened the HD--I'm thinking that's what happened, anyway, because last time I backed up with TM to the external HD, it deleted old files to make room for the new (and I don't have TM files on my internal storage). Anyway, somehow these old TM files got to my Trash bin, and they wouldn't delete. That's common, I now understand. So I read a bit, tried a couple easy things that didn't work, then I found this, which was provided by the user in a different Apple discussion thread:

https://www.imore.com/how-force-empty-trash-your-mac-using-terminal


So I did that command in Terminal: sudo rm -R [space]....etc.


And that was nearly 24 hours ago. Since then, I'm finding the following things and I don't know what to do to safely get out of this mess:

1. Terminal is apparently still running the command, because when I click on the red dot at top left of the Terminal window, I get a prompt that says closing the window will terminate the running processes: rm, sudo ...So I cancel out because I'm afraid to terminate the process, because:

2. Right now, when I open the external HD, the whole thing looks empty. The files that were in the external HD are gone; the window is empty. Although in the terminal command I had only copied and pasted those files that were in the Trash. So I had a some wishful thinking that the Terminal process made it look empty but would restore those file icons soon enough...?

3. And, the desktop Trash bin is indeed now empty.

4. AND, when I open Paragon NTFS and look at the external HD capacity, it comes up the same as my internal storage capacity, but then it switches back to what it was, or would have been, with those old files deleted. (Also an odd thing that it switches back and forth.)

5. When I open Disk Utility, however, it shows an entire 2 TB (the capacity of the HD) as available on the external HD.


What should I do to safely get out of this? Do I cancel the Terminal process? How do I safely cancel it, if that's what should be done, without damaging anything else?


Have I lost all the other files that were on the external hard drive?


Thanks so much for help.

MacBook Pro TouchBar and Touch ID, macOS Sierra (10.12.6), MacBook Pro 2016

Posted on Jan 6, 2018 4:39 PM

Reply
19 replies

Jan 6, 2018 7:06 PM in response to vishnupriya

That command should have only deleted the files in the Trash. I don't know why you see all the files missing off of the disk.

And, since it was waiting for you on that particular file, it didn't even get past the first folder.

If that is the only command you tried, it should not have deleted anything but the folders you selected.


I don't know what is keeping the disk busy. Try restarting instead of ejecting.

There would be nothing putting any files back. That's not how it works.

Jan 7, 2018 5:59 AM in response to vishnupriya

AND the old TM backup files are in the desktop trash bin again.

Well, you never allowed the command to run long enough to delete what was in the Trash. As I stated before, it stopped on the very first folder waiting for you to confirm deletion of a protected file.


I don't have any experience deleting TM items in the Trash. I've never seen it put anything in the Trash and I haven't ever trashed any TM backups.


A lot of strange things happened during this event, so it may be that there is a problem with the drive.

Jan 6, 2018 5:06 PM in response to Barney-15E

After the space it looks like this: /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2015-10-18-232700 ...And there are about 10 of those.

Most of the files on the external HD are backed up elsewhere, but it will take a bit to get them back in one place. And a few were not yet backed up elsewhere.

You wrote: "The damage is already done." So that command will erase everything on the ext HD, not only the files that were in the trash?

Jan 6, 2018 5:14 PM in response to Barney-15E

I'm not sure what you mean by up arrow, but I clicked on that on my keyboard and it makes a up-pointing carrot, then [[A ....? Also, after all those lines that I pasted to delete from the Trash, Terminal typed this: override rw-r--r-- root/wheel restricted,uchg for /Volumes/Vishnupriya Storage-TM 5/.Trashes/501/2015-10-18-232700/Macintosh HD/System/Library/CoreServices/boot.efi?


Don't know what that means, of course.

Jan 6, 2018 5:39 PM in response to Barney-15E

Ok...

By terminate the command, do you mean the Ctrl-C (or closing the window)?

When you say it is waiting for yes/no to delete that particular file--what file do you refer to? I've only pasted there those 10 or so files that were in the Trash. Do you mean those files?

So if I terminate the command without confirming delete, will these TM files end up back in the Trash bin (and also perhaps the other files will show up again in the external HD)?

Also, I'm not sure what you're referring to here "if you only entered that..." -- entered what? The Ctrl-C?

Sorry...I'm trying to follow! I appreciate your help a lot.

Jan 6, 2018 6:41 PM in response to Barney-15E

Ok, thanks Barney-15E, I did exactly what you said and the Terminal window is now closed. Before closing the window, I used the up arrow and the whole command again came there, I copied it and here it is:

sudo rm -R /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2015-10-18-232700 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2015-10-18-234136 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2015-10-19-004300 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2015-10-19-014336 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2015-10-19-024415 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2015-10-19-034456 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2015-10-19-044537 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2015-10-19-054612 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2016-05-16-204711 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2016-06-21-134418 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2016-07-10-134356 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2016-08-18-204340 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2016-12-18-094100 /Volumes/Vishnupriya\ Storage-TM\ 5/.Trashes/501/2016-12-18-125724


That external hard drive is still showing no files in it (the Finder folder for it). I assume something was wrong in the command there and all the files are gone from the ext HD. Unless maybe it will come up if I eject the ext HD and reconnect it. Haven't done that yet.


***I just tried to eject the ext HD and it says one or more programs may be using it. I don't want to force eject it, if it is trying to get the other files back. Do you know what to do here?

Jan 6, 2018 9:01 PM in response to vishnupriya

I went for it and unplugged the external hard drive and plugged it back in, and when the drive mounted on the desk top, I opened the folder and all the files are there--the ones that are supposed to be there. AND the old TM backup files are in the desktop trash bin again. So I'm back to the starting point. THANK YOU for helping me get back to this point "safely".


Do you have any suggestion on how to now finally delete these old TM files from the desktop trash bin?


As a side note, I'm wondering if the ext HD is faulty, and that's why all this is happening. I don't know why these old TM files are stuck on the ext drive and weren't deleted in the last TM backup.

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.

need help getting out of a Terminal sudo command

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