Deleting files with Terminal

On June 15, 2009, in Featured, Mac Top Tips, by Steve

My first top tip is one that I have used a few times in the 10 months I have owned my Mac. The issue in question is files not wanting to leave the trash when deleting the contents of the trash can. Generally these tend to be corrupt images but can be just about anything.

When following this method to remove files from the trash please execute with extreme caution. Failing to do this correctly can result in some nasty outcomes.

The first thing is open up the Terminal, located in the Applications/Utilities folder and you should see something like:

name-of-my-mac:~ username$

At the prompt type:

sudo su -

Now enter you password when prompted. You are logging in as the root user to your machine so from this point you must be very careful!!!

You can now do one of two things, either locate the file using the command line or find the file in Finder and drag the file into the Terminal window. This will show you the location of the file. Navigate to the file from the command prompt in Terminal window, using the cd command.

You can now delete the offending item using the following command:

rm filename.ext

You will be asked to confirm deletion, type yes for yes and no for no… simple!

Hope this helps.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Live
  • MySpace
  • StumbleUpon
  • Technorati
  • Twitter
  • Yahoo! Buzz
  • Ping.fm
  • RSS
Tagged with:  

1 Response » to “Deleting files with Terminal”

Leave a Reply

WordPress Themes
Can't find what you are looking for? Need help on a topic or find something thats not right let me know
WordPress Blog