I have setup the shell script just like the instructions said, but when I tried the "trash" command, it just said "command not found" did I miss something here? ( I am the adminstrator of the iBook)
thanks
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
--
http://www.swizcore.com - My communication design effort(...constantly in progress)
http://callingallheroes.com
Great Lakes Sincerity
Dual 1 ghz Quicksilver : 17" Apple LCD : 100% Jaguar
Sony DCR-TRV830 DV Cam
I have setup the shell script just like the instructions said, but when I tried the "trash" command, it just said "command not found" did I miss something here? ( I am the adminstrator of the iBook)
thanks
mkwan
UNIX was created in the late 1960s, in an effort to provide a multiuser, multitasking system for use by programmers. The philosophy behind the design of UNIX was to provide simple, yet powerful utilities that could be pieced together in a flexible manner to perform a wide variety of tasks.
actually no, I am fairly new to unix operating system. I heard that linux/unix is more superior that Microsoft Windows. I am a longtime mac user, so it was a easy choice for me to stick with Mac OS X.
thanks for the help...(I am doing c++ in terminal...so far it is a pain in the arse)
mkwan
UNIX was created in the late 1960s, in an effort to provide a multiuser, multitasking system for use by programmers. The philosophy behind the design of UNIX was to provide simple, yet powerful utilities that could be pieced together in a flexible manner to perform a wide variety of tasks.
Keeps saying Can't find directory .trash.
Strange.
It sees the command (lists rm etc on the terminal window) but does nothing. ONE time at asked me for my PW but then still said can't find dir (even after using rehash and quiting Terminal too).
PowerBook G4 667MHz | 768 MB RAM | CD-RW | 60GB IBM TravelStar | 100GB FireWire Drive (7,200 RPM, Oxford 911) | Canon Printer & UMAX Scanner | OS X 10.3
"AirPort" (n): 1. Cleared, leveled hard-surfaced area where aircraft take off & land; has control tower, hangars, passenger terminals, & cargo area. 2. Kick-ass, cutting-edge wireless networking technology allowing anyone with a brain to surf the Internet from anywhere in one's home, school, office, local café, pub, or prison cell.
Hey Gadget,
you do have something in the trash can dont you.
if the trash is already empty you will see that error you keep seeing. Put a empty folder in there and run your command.![]()
I'm flattered!Originally posted by testuser
If GadgetLover doesn't mind me quoting him from the other thread:
"Yes! Works great!! Thanks!"
There is also a cosmetic glitch; it takes the Dock a while to update its cache and show an empty Trash can after running one of these scripts. I find that clicking on the Trash, and then closing the window, twice in a row will update the display and show an empty Trash can.
And, yes, I noticed the glitch too ('tis a small price to pay).
PowerBook G4 667MHz | 768 MB RAM | CD-RW | 60GB IBM TravelStar | 100GB FireWire Drive (7,200 RPM, Oxford 911) | Canon Printer & UMAX Scanner | OS X 10.3
"AirPort" (n): 1. Cleared, leveled hard-surfaced area where aircraft take off & land; has control tower, hangars, passenger terminals, & cargo area. 2. Kick-ass, cutting-edge wireless networking technology allowing anyone with a brain to surf the Internet from anywhere in one's home, school, office, local café, pub, or prison cell.
I'm so proud of myself for making a script -- and it worked! I've had things hanging in the trash for a while (privilege casualties and all). I might have to try some other ones now. Is there a good place to learn about scripts, shells, etc? I've glanced at Apple's applescript site but would like more of a tutorial thing. Thanks for the help!
applescriptcentral.com/Originally posted by snowgurl
Is there a good place to learn about scripts, shells, etc? I've glanced at Apple's applescript site but would like more of a tutorial thing. Thanks for the help!
PowerBook G4 667MHz | 768 MB RAM | CD-RW | 60GB IBM TravelStar | 100GB FireWire Drive (7,200 RPM, Oxford 911) | Canon Printer & UMAX Scanner | OS X 10.3
"AirPort" (n): 1. Cleared, leveled hard-surfaced area where aircraft take off & land; has control tower, hangars, passenger terminals, & cargo area. 2. Kick-ass, cutting-edge wireless networking technology allowing anyone with a brain to surf the Internet from anywhere in one's home, school, office, local café, pub, or prison cell.
Bookmarks