|
|
StuffIt Deluxe 12: breakthrough compression of MP3 files, PDFs, iWork and MS Office files! Reduce JPEG file sizes with no loss in quality, burn to CD/DVD, back up archives to iDisk and more. Buy today for only $59.99! <http://www.stuffit.com/mac/deluxe/tb/>
|
TidBITS TidBITS TidBITS Talk 
unable to empty trash rdh (apparently) - 12:28pm Apr 30, 2007 PSTvia emailI recently ran into a problem I've never seen before when setting up
a friend's G4 AL-book, which she had bought used.
We cannot empty the trash if there are any applications in there.
I've set her up as a new user, and deleted the previous owner's user
(where I first encountered the problem). The trash works normally
with non application items, but there are lots of apps that came with
it that my friend will never use - and she would like to get rid of
them.
I recall in earlier (pre X) Os versions, one could 'protect' the
applications folder, and perhaps this is what is happening, but I
couldn't see any setting for this in OS X (10.4). Perhaps I've just
missed it, or is there a 3rd party utility that might be running that
prevents deleting apps. (you can add them, just not delete)?
TIA,
Roger
Roger Henriques
rdh at rhen dot com
Mark as Read
Randy B. Singer (apparently)
-
May 1, 2007 11:13 am
(#1 Total: 15)
|
 |
|
|
via email - Co-Author: The Macintosh Bible (4th, 5th, and 6th editions) |
|
|
 |
| Posts: 206 |
Re: unable to empty trash
On Apr 30, 2007, at 12:28 PM, Roger Henriques wrote:
> I recently ran into a problem I've never seen before when setting up
> a friend's G4 AL-book, which she had bought used.
>
> We cannot empty the trash if there are any applications in there.
Undoubtedly it is a permissions problem. Your friend doesn't have
permission to trash the applications that belong to the previous owner.
A favorite tool to fix permissions for several files or applications
in a batch is:
BatChmod (free, donation requested)
ttp://macchampion.com/arbysoft/
You can also force-empty the trash with BatChmod, or you may prefer:
TrashIt! (free)
http://www.nonamescriptware.com/wordpress/?page_id=5
___________________________________________
Randy B. Singer
Co-author of The Macintosh Bible (4th, 5th, and 6th editions)
Macintosh OS X Routine Maintenance
http://www.macattorney.com/ts.html
___________________________________________
|
|
 |  |
Alexander Hoffman (apparently)
-
May 1, 2007 11:13 am
(#2 Total: 15)
|
 |
|
|
 |
| Posts: 175 |
Re: unable to empty trash
>We cannot empty the trash if there are any applications in there.
This is a a little bit relevant, I hope.
I've had some files that I could not delete. That is, I got a warning
that they were in use and could not be deleted when I tried to empty
the trash.
Actually, it began as a copy of Eudora. Eventually, I looked in the
bundle and found the offending file, and was able to delete the rest.
These files would copy, but would not delete. Due to my own
carelessness, I eventually ended up with three of them, and they
migrated from my PBG4 to my MBP.
I finally sat down to do what I long ago thought to do, delete them
from the command line. It took a minute to figure out the delete
command, as I haven't deleted from a Unix command line in years.
("Hmmm....not 'del'....not 'erase'...not 'delete'...a-ha! 'rm'")
So, if it is particular Apps that won't delete, I've been there, and
using rm was able to take care of it. However, it is apps in general,
you've got quite a different problem.
>I've set her up as a new user, and deleted the previous owner's user
>(where I first encountered the problem)
Well, I would strongly advise reformatting the drive and reinstalling
everything if this is a secondhand computer. There's no way to know
what a previous own has installed or modified or screwed up.
--
=Alex Hoffman
Leadership Policy & Politics
Teachers College, Columbia University
|
|
 |  |
Randy B. Singer (apparently)
-
May 2, 2007 8:58 am
(#3 Total: 15)
|
 |
|
|
via email - Co-Author: The Macintosh Bible (4th, 5th, and 6th editions) |
|
|
 |
| Posts: 206 |
Re: unable to empty trash
On May 1, 2007, at 11:13 AM, Alexander Hoffman wrote:
> I've had some files that I could not delete. That is, I got a warning
> that they were in use and could not be deleted when I tried to empty
> the trash.
I believe that is a different sort of situation than the original
poster is experiencing. I don't think that the problem that you
experienced has to do with permissions.
Sometimes a file or application becomes damaged, for instance when a
file isn't completely downloaded from the Internet. When you go to
trash such a file you may get a message that it can't be trashed
because it is "being used by another application" or it is "in use."
You can try using a utility like TrashIt! to force-trash this file.
Often this will do it.
Another way to deal with this situation:
Use X-RAY
http://www.brockerhoff.net/xray/index.html
MuchoFileInfo
http://www.muchosoft.com/fileinfo.htm
or Modifier
http://www.finikin.com/
to check the offending file's file type. If the file type is "bzy0"
OS X treats such a file as an active file. Change the file type to
"text" and then you can delete it.
___________________________________________
Randy B. Singer
Co-author of The Macintosh Bible (4th, 5th, and 6th editions)
Macintosh OS X Routine Maintenance
http://www.macattorney.com/ts.html
___________________________________________
|
|
 |  |
bitreader (apparently)
-
May 2, 2007 9:03 am
(#4 Total: 15)
|
 |
|
|
 |
| Posts: 120 |
Re: unable to empty trash
On 4/30/07 at 12:28 PM, rdh  rhen.com (Roger Henriques) wrote:
>We cannot empty the trash if there are any applications in there.
>I've set her up as a new user, and deleted the previous owner's user
>(where I first encountered the problem). The trash works normally
>with non application items, but there are lots of apps that came
>with it that my friend will never use - and she would like to get
>rid of them.
I would suspect a permissions/ownership issue. If you have set
up the new user as a normal user without admin rights he/she
will not be able to delete apps installed by the previous owner.
This can be dealt with using sudo and rm in the Terminal from an
admin account. Alternatively, there are a number of third party
apps that will empty the Trash from an admin account such as
OnyX or Cocktail. These are readily obtained on the usual sites
such as VersionTracker.
|
|
 |  |
Chris Pepper (apparently)
-
May 3, 2007 2:24 pm
(#5 Total: 15)
|
 |
|
|
 |
| Posts: 844 |
Re: unable to empty trash
At 12:28 PM -0700 2007/04/30, Roger Henriques wrote:
>I recently ran into a problem I've never seen before when setting up
>a friend's G4 AL-book, which she had bought used.
>
>We cannot empty the trash if there are any applications in there.
>I've set her up as a new user, and deleted the previous owner's user
>(where I first encountered the problem). The trash works normally
>with non application items, but there are lots of apps that came with
>it that my friend will never use - and she would like to get rid of
>them.
>
>I recall in earlier (pre X) Os versions, one could 'protect' the
>applications folder, and perhaps this is what is happening, but I
>couldn't see any setting for this in OS X (10.4). Perhaps I've just
>missed it, or is there a 3rd party utility that might be running that
>prevents deleting apps. (you can add them, just not delete)?
If your friend was not an administrator, they would be unable
to delete the files in /Applications. You can see administrator
status in System Preferences:Accounts.
From the command line "id" will tell you group memberships;
administrators are in group 'admin' (#80).
Alternatively, the applications might be locked, which is an
HFS/HFS+ file attribute that prevents modification or deletion.
There's a checkbox for Locked in each file's Get Info window. If this
is the problem, holding down Option when you Empty Trash might help.
To unlock everything inside /Applications (which probably wouldn't
catch stuff currently in the Trash) use "chflags", as in "sudo
chflags -R nouchg /Applications".
Chris
--
Chris Pepper: < http://www.reppep.com/~pepper/>
< http://www.extrapepperoni.com/>
The Rockefeller University: < http://www.rockefeller.edu/>
|
|
 |  |
cablewim (apparently)
-
May 3, 2007 9:58 pm
(#6 Total: 15)
|
 |
|
|
 |
| Posts: 1 |
Re: unable to empty trash
Randy,
I have a folder that does not want to be deleted. It is in the trash and
everytime I try to empty the trash, it says "operation can not be completed
because file 'xyz' is in use. I click on "continue" and the trash is
emptied, except for that one  #$ folder and the nect time I try to empty the
trash, I go through the same routine!
Do you have a suggestion?
Thanks in advance,
Cablewim-at-hotmail.com
|
|
 |  |
Randy B. Singer (apparently)
-
May 4, 2007 4:52 am
(#7 Total: 15)
|
 |
|
|
via email - Co-Author: The Macintosh Bible (4th, 5th, and 6th editions) |
|
|
 |
| Posts: 206 |
Re: unable to empty trash
On May 3, 2007, at 9:58 PM, Wim Wijnberg wrote:
> I have a folder that does not want to be deleted. It is in the trash and
> everytime I try to empty the trash, it says "operation can not be completed
> because file 'xyz' is in use. I click on "continue" and the trash is
> emptied, except for that one  #$ folder and the nect time I try to
> empty the trash, I go through the same routine!
> Do you have a suggestion?
Sure.
I just posted about this here a few days ago.
Sometimes a file or application becomes damaged, for instance when a
file isn't completely downloaded from the Internet. When you go to
trash such a file you may get a message that it can't be trashed
because it is "being used by another application" or it is "in use."
You can try using a utility like TrashIt! to force-trash this file.
Often this will do it.
TrashIt! (free)
http://www.nonamescriptware.com/wordpress/?page_id=5
Another way to deal with this situation:
Use X-RAY
http://www.brockerhoff.net/xray/index.html
MuchoFileInfo
http://www.muchosoft.com/fileinfo.htm
or Modifier
http://www.finikin.com/
to check the offending file's file type. If the file type is "bzy0"
OS X treats such a file as an active file. Change the file type to
"text" and then you can delete it.
___________________________________________
Randy B. Singer
Co-author of The Macintosh Bible (4th, 5th, and 6th editions)
Macintosh OS X Routine Maintenance
http://www.macattorney.com/ts.html
___________________________________________
|
|
 |  |
David Weintraub (apparently)
-
May 7, 2007 5:31 am
(#8 Total: 15)
|
 |
|
|
 |
| Posts: 235 |
Re: unable to empty trash
On May 4, 2007, at 12:58 AM, Wim Wijnberg wrote:
> I have a folder that does not want to be deleted.
Two suggestions:
1). Reboot (or you can try logging out). Mac OS X attempts to track
which process is accessing which files. Sometimes one of these
processes forgets to "unlock" the file before quitting. Rebooting
will reset this:
2). Bring up a command terminal cd to the ".Trash" directory, and do
a "rm -rf *". The Unix side of Mac OS X doesn't track file locking,
so it will delete a file in the trash even if Mac OS X thinks it is
in use. If "rm -rf *" doesn't do the job, do a "sudo rm -rf *".
You'll be asked for an administrative password. If you're an
administrator of your machine, your password will do. Afterwards, do
an "ls -a" and see if it lists any files (besides "." and "..").
--
David Weintraub
david  weintraubworld.net
david  weintraub.name
|
|
 |  |
johnbaxterlists (apparently)
-
May 8, 2007 7:14 am
(#9 Total: 15)
|
 |
|
|
 |
| Posts: 660 |
Re: unable to empty trash
On May 7, 2007, at 5:31 AM, David Weintraub wrote:
> 2). Bring up a command terminal cd to the ".Trash" directory, and do
> a "rm -rf *". The Unix side of Mac OS X doesn't track file locking,
> so it will delete a file in the trash even if Mac OS X thinks it is
> in use. If "rm -rf *" doesn't do the job, do a "sudo rm -rf *".
> You'll be asked for an administrative password. If you're an
> administrator of your machine, your password will do. Afterwards, do
> an "ls -a" and see if it lists any files (besides "." and "..").
For anyone, that is scary advice (see 1. below) and for some it won't
work as stated (see 2 below).
In what follows, xxx is the user with the problem; yyy (when needed)
is an administrative user.
1. First, consider someone running as an administrative user (not
really a good idea for one's day to day account, but very common).
cd .Trash
sudo rm -rf *
is workable BUT--
cd .Tarsh
--fail to notice the error message, so you are still in your home
directory
sudo rm -rf *
also "works"--to empty out the account's home directory, including
little things like ~/Documents and ~/Music and ~/Pictures. Many
people are unhappy when that happens.
I suggest instead
cd .Trash
pwd
[Verify that the result from pwd (print working directory) is /Users/
xxx/.Trash ]
sudo rm -rf * [NO RETURN YET]
Take hands away from keyboard. Review what has been typed and
particularly the result from the pwd. Now hit return. The password
prompt is asking for the xxx account password.
Paranoia:
sudo -K
(This shuts off the 5 minute period during which sudo won't need a
password.)
2. The sudo command takes the password of the account which issues
it. (In item 1, the account xxx.) It will reject any other password.
If one normally runs as a non-administrative user (good!), bring up
Terminal and type
su - yyy
[There will be a Password: prompt--this is the password for the yyy
account (an administrator)--no other will be accepted.]
You are now running as user yyy, and have started in yyy's home
directory (there are ways to avoid that, which lead to odd error
messages that can be dealt with but are a nuisance).
Now
cd ~xxx/.Trash
(longer alternative: cd /Users/xxx/.Trash which avoids the
possibility of forgetting the "~" and landing in yyy's own xxx
directory if she has one.)
pwd
[Verify as stated in #1]
sudo rm -rf * [NO RETURN YET]
As in #1, hands off the keyboard, verify what is about to happen,
then hit return. The password being asked for is for the yyy account.
sudo -K
exit
(You're again running as xxx.)
Note: I haven't often done a "wild rm -rf" but the one that taught
me care was a "good" one: I removed the home directories for about
half of my ISP employer's users, on our primary server. (We did have
backup.)
Note 2: There are ways to avoid the dance in section 2, by editing /
etc/sudoers (the odd name means those who can use sudo), but unless
you're John Welch or another Unix guru, I suggest you forget anyone
ever told you that, so I won't tell you the right way to edit that file.
--John (The fact that I'm paranoid doesn't mean they aren't out to
get me.)
|
|
 |  |
Lewis Butler (apparently)
-
May 8, 2007 3:41 pm
(#10 Total: 15)
|
 |
|
|
 |
| Posts: 1080 |
Re: unable to empty trash
On 8-May-2007, at 08:14, johnbaxterlists  mac.com wrote:
> Note 2: There are ways to avoid the dance in section 2, by editing /
> etc/sudoers (the odd name means those who can use sudo), but unless
> you're John Welch or another Unix guru, I suggest you forget anyone
> ever told you that, so I won't tell you the right way to edit that
> file.
I will because it's very easy to do and also fairly idiotproof<1>.
There is a program named visudo. You need to be an admin to run it
(either the root user or a member of the 'admin' group').
The file is pretty well commented by default, but what you are
looking for is these lines:
# User privilege specification
root ALL=(ALL) ALL
%admin ALL=(ALL) ALL
The easiest thing to do is simply copy this line (press j until the
cursor is on the root line and then press yyp to do a yank/place that
line change the 'root' to your user name (press cw and then type in
your short user name):
# User privilege specification
root ALL=(ALL) ALL
kreme ALL=(ALL) ALL
%admin ALL=(ALL) ALL
Now just hit 'ZZ' (case matters) and you're done.
Now, note that this will NOT make you an admin as far as OS X is
concerned, but it will allow you to sudo from the command line. You
will have to provide your password in order to use sudo.
I find this is a perfectly reasoanble trade-off between running as an
admin (way too dangerous for my tastes) and having to su to the admin
user and then sudo (just too obnoxious to have a different $HOME when
I am adminning).
<1> It is idiotproof because if you try to exit visudo with a file
that is munged in some way, visudo will not write out the file.
|
|
 |  |
jwbaxter (apparently)
-
May 8, 2007 3:41 pm
(#11 Total: 15)
|
 |
|
|
 |
| Posts: 70 |
Re: unable to empty trash
The very nice recipe for non-admin users doesn't work. Sorry about
that. I saw the flaw as soon as I read my post.
Let's try again (tested this time).
su - yyy
(yyy's password)
sudo -s
(yyy's password)
CAUTION: you now have the power of root. If bash is the shell for
both xxx and yyy, the prompt has changed from $ to #.
> Now
> cd ~xxx/.Trash
> (longer alternative: cd /Users/xxx/.Trash which avoids the
> possibility of forgetting the "~" and landing in yyy's own xxx
> directory if she has one.)
> pwd
> [Verify as stated in #1]
rm -rf * [NO RETURN YET]
> As in #1, hands off the keyboard, verify what is about to happen,
> then hit return. The password being asked for is for the yyy account.
exit
(You are again yyy)
sudo -K
(for the paranoid)
exit
(now xxx again)
--John
On May 8, 2007, at 7:14 AM, johnbaxterlists  mac.com wrote:
WON'T WORK--see above.
> 2. The sudo command takes the password of the account which issues
> it. (In item 1, the account xxx.) It will reject any other password.
> If one normally runs as a non-administrative user (good!), bring up
> Terminal and type
> su - yyy
> [There will be a Password: prompt--this is the password for the yyy
> account (an administrator)--no other will be accepted.]
>
> You are now running as user yyy, and have started in yyy's home
> directory (there are ways to avoid that, which lead to odd error
> messages that can be dealt with but are a nuisance).
> Now
> cd ~xxx/.Trash
> (longer alternative: cd /Users/xxx/.Trash which avoids the
> possibility of forgetting the "~" and landing in yyy's own xxx
> directory if she has one.)
> pwd
> [Verify as stated in #1]
> sudo rm -rf * [NO RETURN YET]
> As in #1, hands off the keyboard, verify what is about to happen,
> then hit return. The password being asked for is for the yyy account.
> sudo -K
> exit
> (You're again running as xxx.)
--
John W Baxter
jwbaxter  mac.com
|
|
 |  |
Chris Pepper (apparently)
-
May 8, 2007 3:41 pm
(#12 Total: 15)
|
 |
|
|
 |
| Posts: 844 |
Re: unable to empty trash
At 7:14 AM -0700 2007/05/08, johnbaxterlists  mac.com wrote:
>I suggest instead
>cd .Trash
>pwd
>[Verify that the result from pwd (print working directory) is /Users/
>xxx/.Trash ]
>sudo rm -rf * [NO RETURN YET]
>Take hands away from keyboard. Review what has been typed and
>particularly the result from the pwd. Now hit return. The password
>prompt is asking for the xxx account password.
I agree about the importance of a moment of reflection before
doing "rm *". I deleted half of the X11 installation on my employer's
server with my memorable mistake.
Personally, I try very hard to avoid "rm *". I'd instead
suggest "cd ; sudo rm -rf .Trash", so if you mistype .Trash it is
unlikely to do anything at all.
>You are now running as user yyy, and have started in yyy's home
>directory (there are ways to avoid that, which lead to odd error
>messages that can be dealt with but are a nuisance).
>Now
>cd ~xxx/.Trash
>(longer alternative: cd /Users/xxx/.Trash which avoids the
>possibility of forgetting the "~" and landing in yyy's own xxx
>directory if she has one.)
>pwd
>[Verify as stated in #1]
>sudo rm -rf * [NO RETURN YET]
>As in #1, hands off the keyboard, verify what is about to happen,
>then hit return. The password being asked for is for the yyy account.
>sudo -K
>exit
>(You're again running as xxx.)
Again, I'd avoid "rm *" by putting the intended path
explicitly into the command: "sudo rm -rf ~xxx/.Trash". This makes it
substantially harder to shoot yourself in the foot.
Chris
--
Chris Pepper: < http://www.reppep.com/~pepper/>
< http://www.extrapepperoni.com/>
The Rockefeller University: < http://www.rockefeller.edu/>
|
|
 |  |
andy.carroll (apparently)
-
May 9, 2007 11:30 am
(#13 Total: 15)
|
 |
|
|
 |
| Posts: 7 |
Re: unable to empty trash
I'm not sure how it works, but I can usually empty sticky trash
things by holding down the Option key while selecting Empty Trash
from the Finder menu.
Sometimes a restart is necessary before that trick works, but I've
never had to resort to changing permissions or delving into Unix
commands.
--
Andy Carroll
Toronto, Canada
http://flickr.com/photos/andys_camera/
|
|
 |  |
cdevers (apparently)
-
May 9, 2007 11:30 am
(#14 Total: 15)
|
 |
|
|
 |
| Posts: 152 |
Re: unable to empty trash
On May 8, 2007, at 10:14 AM, johnbaxterlists  mac.com wrote:
> For anyone, that is scary advice
What he said.
In my opinion, the safer thing to do is figure out *why* you can't
empty the trash the normal way.
It's almost always the case that one program has a lock a file you
want to delete. If you force-remove the file, you're going to mess up
that program, too.
For example, on my desktop right now, I have a .dmg in my trash, but
I can't empty it, because that .dmg is mounted (on the Desktop, in
the Finder, etc), and so can't be erased yet. Very reasonable, and in
this case obvious, but that isn't always how it works out.
If you use `lsof`, it will give you hints about what the problem is:
$ lsof | grep -i '\.Trash'
Finder 414 cdevers 13r VDIR 14,5 102
8391345 /Users/cdevers/.Trash
diskimage 20701 cdevers 5r VREG 14,5 810209
8786711 /Users/cdevers/.Trash/KeywordAssistant-1.9.4.dmg
$
There it is. The Finder, at process ID 414 (from the second column),
has the Trash open, but that's normal. The other one here is process
iD 20701:
$ ps wwwax | grep 20701
20701 ?? Ss 1:19.76 /System/Library/PrivateFrameworks/
DiskImages.framework/Resources/diskimages-helper -uuid
59F1C128-8194-493B-9CB6-350EE3441FB7
$
In this case, the solution is just to eject the disk image, but you
can also relatively safely just kill the process that is using the file:
$ kill 20701
After that, you should just be able to empty the Trash the old
fashioned way.
And you don't even need sudo! :-)
--
Chris Devers
|
|
 |  |
rickl
-
May 10, 2007 12:11 pm
(#15 Total: 15)
|
 |
|
|
 |
| Posts: 16 |
Re: unable to empty trash
|
|
|
TidBITS TidBITS TidBITS Talk unable to empty trash
|
|