How do I delete a locked, invisible file in the Trash?
The file could simply still be open by something. Use lsof &lt;file&gt; to see which process is hogging it, if any.
Otherwise sudo rm -rf /.Trashes/501/Users/myusername/Desktop should get rid of it
If that didn't work, try removing all the flags it's complaining about first: chflags nohidden,nosappdn,noarch,noschg &lt;file&gt;