delete stubborn files?

macrlz9

macrumors 6502
Original poster
Dec 6, 2003
424
27
Long Island, NY
i'm sure this has been covered before as i have seen it posted somewhere but i can not remember how to delete a file using the terminal that will not delete! i can put it in the trash but it won't empty the trash, i can restart adn still it won't delete, i can change the permissions and still no luck... .the files name is "Stuff" and it's on my desktop so if anyone knows what i need to type in the terminal to delete it i think the path would be Macintosh HD>Users>Anthony>Desktop>Stuff but any help would be greatly appreciated as the full trash can looks messy and is driving me nuts!!!!!! thanks :D
 

jsw

Moderator emeritus
Mar 16, 2004
22,910
41
Andover, MA
Open Terminal.

Type "sudo rm -f " (no quotes, don't hit return yet, but note the trailing space).

In Finder, click on the offending file and drag it to the Terminal window - the full path should fill in after what you'd typed before.

Verify that it's the correct file, then hit enter. You'll be asked for your admin password. Enter it. The file should go away. Post back if it doesn't.

Note: try the above first without the "sudo ", and that might also work. It's a bit safer, but you might need the sudo ("super-user do").
 

macrlz9

macrumors 6502
Original poster
Dec 6, 2003
424
27
Long Island, NY
well it won't work cuz it's a directory, and there are a lot of files in that directory, i tried deleting them individually but none of the files would delete like normal... how do i delete a whole directory?
 

jsw

Moderator emeritus
Mar 16, 2004
22,910
41
Andover, MA
macrlz9 said:
well it won't work cuz it's a directory, and there are a lot of files in that directory, i tried deleting them individually but none of the files would delete like normal... how do i delete a whole directory?
Change the "-f" to "-rf". And be sure there's a space afterwards:

sudo rm -rf /the/complete/path/to/the/folder
 

Similar threads

  • Jacob Brown
3
Replies
3
Views
307
Replies
1
Views
397
  • madoka
6
Replies
6
Views
869
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.