Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Page 1 of 3 123 LastLast
Results 1 to 8 of 23
  1. #1
    swizcore's Avatar
    swizcore is offline Help Guide Coordinator
    Join Date
    Sep 2001
    Location
    Michigan USA
    Posts
    336
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How-to: Empty the trash of stubborn itmes

    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

  2. #2
    mkwan's Avatar
    mkwan is offline Tech
    Join Date
    Aug 2001
    Location
    Canada
    Posts
    241
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  3. #3
    mkwan's Avatar
    mkwan is offline Tech
    Join Date
    Aug 2001
    Location
    Canada
    Posts
    241
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  4. #4
    GadgetLover's Avatar
    GadgetLover is offline Senior Member & Tech Guru
    Join Date
    Sep 2001
    Location
    Planet Earth (last I checked).
    Posts
    413
    Thanks
    0
    Thanked 0 Times in 0 Posts

    no go

    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.

  5. #5
    MooDog is offline Registered User
    Join Date
    Jun 2001
    Location
    Baltimore, Maryland
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  6. #6
    GadgetLover's Avatar
    GadgetLover is offline Senior Member & Tech Guru
    Join Date
    Sep 2001
    Location
    Planet Earth (last I checked).
    Posts
    413
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copying is the sincerest form of flattery (except to M$)

    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.
    I'm flattered!

    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.

  7. #7
    snowgurl is offline Registered User
    Join Date
    Jun 2001
    Location
    Montana
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    This worked great! Thanks.

    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!

  8. #8
    GadgetLover's Avatar
    GadgetLover is offline Senior Member & Tech Guru
    Join Date
    Sep 2001
    Location
    Planet Earth (last I checked).
    Posts
    413
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: This worked great! Thanks.

    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!
    applescriptcentral.com/
    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.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. How to force empty the trash??
    By kadoche in forum Mac OS X System & Mac Software
    Replies: 10
    Last Post: March 18th, 2004, 06:34 PM
  2. Ugh! Faster way to empty Trash? Or delete huge amounts?
    By Jasoco in forum Mac OS X System & Mac Software
    Replies: 4
    Last Post: December 22nd, 2002, 06:21 AM
  3. [HOWTO] Selectively delete items in the trash
    By gatorparrots in forum HOWTO & FAQs
    Replies: 2
    Last Post: December 13th, 2002, 10:59 AM
  4. Replies: 9
    Last Post: November 9th, 2002, 12:17 AM
  5. Can't delete or move items from trash.
    By chenly in forum Mac OS X System & Mac Software
    Replies: 5
    Last Post: April 1st, 2002, 04:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •