Help me delete some files in mac's unix

cool11

macrumors 65816
Original poster
Sep 3, 2006
1,469
128
My mbp seems to be in serious trouble.
It does not boot, and I am trying to find what is going on.
Meanwhile, in case I give it to an apple service, I need to delete some of my own files.\
The one and only way to have some access to my files, is by entering th unix mode, pressing command-s during startup.
I do not know unix.
I google it and try to do it, but I fail.

So, I go to the directory I want, typing 'cd'.
Then I type
rm filename

The system display:
override rw-r--r-- 502/admin for filename?

I press
y

And then the system display:
rm: filename: read-only file system

The file cannot be deleted.
It is a file that I created. It is my file, not a 'system' file.
I get freak when I am thinking I should deal with 'permissions' or 'ownership', but please tell me an easy way to be able to delete personal files that I created.
 

aristobrat

macrumors G5
Oct 14, 2005
12,248
1,319
And then the system display:
rm: filename: read-only file system

The file cannot be deleted.
If your file system is mounted read-only, then no changes can be made while it's read-only.

Maybe someone can give you a suggestion for how to unmount it and then remount it as read-write. I don't know the OS X disk structure that well.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
29,333
8,959
California
MBP early 2011. Mavericks.
I assume here you have a backup and just want to erase what is on the drive now?

If so, hold command-r keys both at once when booting to get to the recovery screen. Then start Disk Utility are erase Macintosh HD. That will erase your data and the OS. If you want to reinstall the OS after this just quit Disk Utility then click Reinstall OS X.
 

cool11

macrumors 65816
Original poster
Sep 3, 2006
1,469
128
Due to a severe problem I can't get in recovery mode.
This unix environment, is the only way to do something.
I am one step away from service and I just want to delete some files before I deliver it there.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
29,333
8,959
California
Due to a severe problem I can't get in recovery mode.
This unix environment, is the only way to do something.
I am one step away from service and I just want to delete some files before I deliver it there.
Okay... fair warning. This will nuke your entire users folder and all your data. Type the below command in at the command prompt from that command-s single user mode you booted into. Substitute your account's actual username at the end there. Or you can just leave the username off and it will erase all user accounts.

You will be prompted for your admin password.

Code:
sudo rm -rf /Users/username
 

BrianBaughn

macrumors 603
Feb 13, 2011
6,364
938
Baltimore, Maryland
Okay... fair warning. This will nuke your entire users folder and all your data. Type the below command in at the command prompt from that command-s single user mode you booted into. Substitute your account's actual username at the end there. Or you can just leave the username off and it will erase all user accounts.

You will be prompted for your admin password.

Code:
sudo rm -rf /Users/username
Hey Weaselboy...can he run:

Code:
fsck_hfs
from single user mode with the end result his disk being mounted as read/write? I ran into a similar issue recently but was able to make the disk writable that way except I was booted from the recovery partition and using Terminal.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
29,333
8,959
California
Hey Weaselboy...can he run:

Code:
fsck_hfs
from single user mode with the end result his disk being mounted as read/write? I ran into a similar issue recently but was able to make the disk writable that way except I was booted from the recovery partition and using Terminal.
It is worth a try, but I think OP's issue is more related to permissions.