On an external disk (that contains a clone), the /.Trashes/501/Users/myusername/Desktop folder contains (within some subfolders) a locked invisible file that I cannot delete. The whole folder starting with 'Users' is visible in the Trash in my Dock.

I have tried:

  1. secure empty trash (it asks whether I want to delete locked files and I say yes)

  2. empty trash via Cocktail

  3. launched Terminal as root and went down to the file (admin user alone cannot cd into ./Trashes)

  4. files has these properties: -rw-------@ 1 myusername myusername 4635 Mar 3 2010 int10923.ris

  5. rm asks me whether I want to override override rw------- myusername/myusername sappnd,arch,schg,hidden for int10923.ris?

  6. I say yes, and it answers: Operation not permitted

  7. a get info on the file (in the Dock trash, first enabling viewing of invisible files for the Finder) shows it as locked but unchecking the box, it immediately re-checks itself, it permissions are myusername Read & Write, everyone No Access, trying to change that immediately reverts back to its previous state

  8. trying chflags nouchg or chflags dump on the file changes nothing (with Terminal running as root)

  • 1
    Did you try sudo rm [filename]?
    – daviesgeek
    Commented Aug 19, 2011 at 0:08
  • I had to launch the whole Terminal.app as root which brings sudo powers (and that did not solve it), removing the flags manually was what was needed.
    – noirdesir
    Commented Aug 19, 2011 at 0:52
  • Well...it was worth a shot.
    – daviesgeek
    Commented Aug 19, 2011 at 3:38

3 Answers 3

  1. The file could simply still be open by something. Use lsof <file> to see which process is hogging it, if any.
  2. Otherwise sudo rm -rf /.Trashes/501/Users/myusername/Desktop should get rid of it
  3. If that didn't work, try removing all the flags it's complaining about first: chflags nohidden,nosappdn,noarch,noschg <file>
  • Thanks, 3. did it, I should have googled these flags a bit more, unfortunately, man chflags has no mentions of nohidden,nosappnd,noarch, and noschg.
    – noirdesir
    Commented Aug 19, 2011 at 0:50
  • 1
    no*** flags are just the negation of the *** flags, which are documented on the manpage.
    – zneak
    Commented Aug 19, 2011 at 4:29
  • Problem was I was just scanning the man page for commands and not reading much of the prose around it. As I came with the advice of chflags nouchg to the man page, I just focussed on that list starting with 'nouchg' without reading the paragraph on top of it.
    – noirdesir
    Commented Aug 19, 2011 at 15:25

In order to modify a file that has the schg and/or sappnd bits set, you must be started up in Single-User mode.

See man chflags for more information:

As discussed in chflags(2), the sappnd and schg flags may only be unset when the system is in single-user mode.

  • 1
    As I said above, launching Terminal as root and running chflags nosappnd did work.
    – noirdesir
    Commented Aug 19, 2011 at 15:26

I am basically using the FEmp2, you can take a quick look at http://www.macupdate.com/app/mac/38723/femp

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .