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

jgelin

macrumors 6502a
Original poster
Jul 30, 2015
905
1,073
St Petersburg, FL
Hello all
I am having quite some trouble emptying the Trash from my iMac. I deleted an inProgress file from a hungup time machine backup and now it is stuck in the trashcan.
I have followed these steps here: http://pondini.org/TM/E6.html but to no avail, and the file still persists.
When I run the command in the above site, I get some directories listed after it is run saying that each listed directory is not empty?
What should I do?
Would Verifying/Repairing the disk help?
Thank you!
 

richard2

macrumors regular
Oct 21, 2010
236
51
England, United Kingdom
Try the following:

  1. Open Terminal,
  2. Enter the following:

    shopt -s dotglob; sudo chflags -R noschg,nouchg ~/.Trash/* && sudo rm -Rf ~/.Trash/*

The correct way of deleting Time Machine backups is to execute "sudo tmutil delete <Path>".
 
Last edited:
  • Like
Reactions: jgelin

jgelin

macrumors 6502a
Original poster
Jul 30, 2015
905
1,073
St Petersburg, FL
shopt -s dotglob; sudo chflags -R noschg,nouchg ~/.Trash/* && sudo rm -Rf ~/.Trash/*
And using this command will leave my other files intact? just making sure as this contains lots of commands that I am unfamiliar with.
[doublepost=1463539241][/doublepost]
Try the following:

  1. Open Terminal,
  2. Enter the following:

    shopt -s dotglob; sudo chflags -Rh noschg,nouchg ~/.Trash/* && sudo rm -Rf ~/.Trash/*

The correct way of deleting Time Machine backups is to execute "sudo tmutil delete <Path>".
And here is the output when running this command:
 

Attachments

  • Screen Shot 2016-05-17 at 10.40.04 PM.png
    Screen Shot 2016-05-17 at 10.40.04 PM.png
    28.8 KB · Views: 820

richard2

macrumors regular
Oct 21, 2010
236
51
England, United Kingdom
Code:
shopt -s dotglob;

Make the wildcard character "*" match files with names that begin with a dot. (This probably isn't necessary, but it won't cause any harm.) The semicolon means "then execute the following command".

Code:
sudo chflags -R noschg,nouchg ~/.Trash/* &&

Remove the system immutable and user immutable flags from all of the files in the folder ~/.Trash. The double-ampersand means "if the previous command was executed successfully, then execute the following command".

Code:
sudo rm -Rf ~/.Trash/*

Forcefully and recursively delete all of the files in the folder ~/.Trash.

And here is the output when running this command:

Oops! I've corrected the command in my original post. :)
 
Last edited:
  • Like
Reactions: jgelin

jgelin

macrumors 6502a
Original poster
Jul 30, 2015
905
1,073
St Petersburg, FL
sudo chflags -Rh noschg,nouchg ~/.Trash/* &&
It is here where it seems to be having issue, the -R and -h cannot be combined into an -rh, do advise, see screenshot.

And you are AMAZING for breaking it down like that to explain what will happen step by step!!
 

Attachments

  • Screen Shot 2016-05-17 at 10.40.04 PM.png
    Screen Shot 2016-05-17 at 10.40.04 PM.png
    28.8 KB · Views: 557

richard2

macrumors regular
Oct 21, 2010
236
51
England, United Kingdom
Er, actually, the following is the correct procedure:

  1. Open Terminal.
  2. Type the following:

    sudo chflags -R noschg,nouchg
  3. Type a space.
  4. Drop the folder you wish to delete onto the Terminal window.
  5. In Terminal, press return.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.