swizcore
Help Guide Coordinator
This How-to submitted by: testuser.
Thanks for the contribution.
Sometimes when trying to empty the trash we run up against an
"Insufficient privileges" error that prevents us from deleting junk
files. I wrote a simple shell script that can be run from the
terminal to empty the trash when the Finder will not permit us to do
so.
I suggest creating this shell script using a text editor like BBEdit
Lite ( http://www.bbedit.com/bbedit_for_X.html ), or with your
favorite text editor in the Terminal. First, make a new folder in
your home directory entitled "bin" (without the quotation marks).
Save the shell script in "bin" as a text file with unix line-breaks.
#!/bin/sh
sudo chflags -R nouchg ~/.Trash/*
sudo rm -R ~/.Trash
I called my shell script "trash". After saving it open the terminal
and enter the following to turn "trash" into a command:
chmod +x ~/bin/trash
Now whenever you run up against "Insufficient privileges", simply
open up the terminal and type your command:
trash
You will be asked for your password, and then the power of unix in
Mac OS X will now work for you, instead of against you!
Note: you need to be a user with Administrative privileges on your
Mac (as is the first User created during installation). If you are
trying to delete files on a volume other than your startup volume,
you need to modify the shell script by adding the following lines:
sudo chflags -R nouchg /volume_name/.Trashes
sudo rm -R /volume_name/.Trashes
--
Thanks for the contribution.
Sometimes when trying to empty the trash we run up against an
"Insufficient privileges" error that prevents us from deleting junk
files. I wrote a simple shell script that can be run from the
terminal to empty the trash when the Finder will not permit us to do
so.
I suggest creating this shell script using a text editor like BBEdit
Lite ( http://www.bbedit.com/bbedit_for_X.html ), or with your
favorite text editor in the Terminal. First, make a new folder in
your home directory entitled "bin" (without the quotation marks).
Save the shell script in "bin" as a text file with unix line-breaks.
#!/bin/sh
sudo chflags -R nouchg ~/.Trash/*
sudo rm -R ~/.Trash
I called my shell script "trash". After saving it open the terminal
and enter the following to turn "trash" into a command:
chmod +x ~/bin/trash
Now whenever you run up against "Insufficient privileges", simply
open up the terminal and type your command:
trash
You will be asked for your password, and then the power of unix in
Mac OS X will now work for you, instead of against you!
Note: you need to be a user with Administrative privileges on your
Mac (as is the first User created during installation). If you are
trying to delete files on a volume other than your startup volume,
you need to modify the shell script by adding the following lines:
sudo chflags -R nouchg /volume_name/.Trashes
sudo rm -R /volume_name/.Trashes
--