Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Using Terminal to delete a file?

Using Terminal to delete a file?
Thread Tools
Senior User
Join Date: Nov 2003
Status: Offline
Reply With Quote
Sep 4, 2006, 07:44 PM
 
Hi, I have an old Adobe GoLive CS folder that will cause OS X to crash if I try to empty the trash.

I get a spinning beach ball and I cannot force quit the Finder or use any other applications. My only solution is to hold down the power button to turn of the comp.

Since I cannot figure out a way to delete this file via OS X, is the next step to delete the file with RM in terminal?

TIA
     
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Sep 4, 2006, 07:58 PM
 
rm -rf /path/to/foldername

Be very very careful with rm -rf.
     
Mac Elite
Join Date: May 2001
Location: Earth
Status: Offline
Reply With Quote
Sep 4, 2006, 10:22 PM
 
Try to repair the disk/permissions with Disk Utility and see if this helps.
     
Mac Enthusiast
Join Date: Sep 2005
Location: Canada... be nice, eh?
Status: Offline
Reply With Quote
Sep 4, 2006, 10:42 PM
 
A little trick I use for RM, is to navigate to the directory it is in first. Then ls just to make sure I am in the right directory. Then when using the RM command as mentioned above, start typing the folder name and hit the TAB key. Terminal will prefill the folder name for you, including the correct way to show any spaces. Less chance of a typo or accidently putting in the wrong path...
My Blog-pakos.me
     
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status: Offline
Reply With Quote
Sep 4, 2006, 10:44 PM
 
Try to repair the disk/permissions with Disk Utility and see if this helps.
That would be a complete waste of time.

You can only repair the permissions of files installed by Installer. Also, even if this file was installed by Installer, it would still not work since it is no longer in its original location.
Vandelay Industries
     
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Sep 4, 2006, 11:21 PM
 
Repairing permissions would be a complete waste of time. Repairing the disk obviously wouldn't, since that's where the problem is.
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Sep 4, 2006, 11:52 PM
 
There is no way that permissions could cause OS X to crash when trying to empty the trash.

DiskWarrior is what you need.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status: Offline
Reply With Quote
Sep 5, 2006, 01:24 AM
 
Originally Posted by TETENAL
Repairing permissions would be a complete waste of time. Repairing the disk obviously wouldn't, since that's where the problem is.
You're right. I misread the suggestion as repairing disk permissions not repairing the disk and permissions.
Vandelay Industries
     
Dedicated MacNNer
Join Date: Sep 2003
Location: Louisiana, US
Status: Offline
Reply With Quote
Sep 22, 2006, 06:22 PM
 
there are some directories where you will not have permission to modify the files. In these cases you will have to:

sudo rm -rf /path/to/file.xxx
>enter admin password<

or if you have a lot of these to do in different directories you can do this:

sudo -s
rm -rf /path/to/file.xxx

the second example will save the password for as long as you have that terminal window open, so be VERY careful!!!

And with both cases, do not use either command unless you are 100% of what you are deleting!!
     
Fresh-Faced Recruit
Join Date: Oct 2006
Status: Offline
Reply With Quote
Oct 2, 2006, 11:48 PM
 
I tend to use: rm -rfi

Still dangerous, but it does give you one last chance to bail out (or confirm).
     
Mac Enthusiast
Join Date: Dec 2000
Status: Offline
Reply With Quote
Oct 3, 2006, 06:07 AM
 
Easy, no-chance-of-****ing-up method:

1. Open Terminal window

2. Type 'sudo rm -rf ' (Yes, that is a space on the end. Do not press enter.)

3. Drag the offending folder into the terminal window. Its path should be entered after the text you have typed.

4. Press enter/return.

5. Type your admin password.

6. Wait until the prompt appears again (may take some time).

7. Quit Terminal.

No fuss... no chance of deleting the wrong thing by typing the commands wrong.
     
   
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 01:19 AM.
All contents of these forums © 1995-2015 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2015, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2