![]() |
UNIX/Console question - Printable Version +- MacResource (https://forums.macresource.com) +-- Forum: My Category (https://forums.macresource.com/forumdisplay.php?fid=1) +--- Forum: Tips and Deals (https://forums.macresource.com/forumdisplay.php?fid=3) +--- Thread: UNIX/Console question (/showthread.php?tid=31673) Pages:
1
2
|
UNIX/Console question - Glued - 04-17-2007 While in the console (black back, white type - command s @ startup), how does someone login or gain administration abilities? I can see a director I need to rm or delete, but it says read only. It's my computer, but if I type my login and password at the prompts it tells me my login is incorrect (the one I use when I boot the computer up into OSX). If I try to mount the disk from the console, I get a kernel panic (has to do with a situation I describe in an earlier thread: http://forums.macresource.com/read/1/282679 I know whacking things from the console can be dangerous, but I am left with no other option. I just need to know how to gain the privilege of whacking. Thanks everyone. Re: UNIX/Console question - microchip13 - 04-17-2007 What are you trying to accomplish? Re: UNIX/Console question - Glued - 04-17-2007 a file 'corrupted' while decoding overnight and grew to such a size as to overtake all free space. The drive will not boot up now, because it doesn't have enough free space "to think". My goal is to either A) delete the oversized file (or it's directory if need be) or b) delete enough (known) files as to create breathing room for the system. Re: UNIX/Console question - microchip13 - 04-17-2007 Alright. After you get into single user mode, as it says, run the scripts it says to mount the hard drive in read right, after that you should be set. Re: UNIX/Console question - Glued - 04-17-2007 that's what I was afraid of. I get a kernel panic when I run either /sbin/mount -uw / or sh /etc/rc. Is there ANY other way I can get privilege to delete? Re: UNIX/Console question - ztirffritz - 04-17-2007 Command+S = Single user mode ls = list folder contents rm = remove file aka. "delete" rmdir = remove directory su = Switch User (it defaults to root user if you don't specify a username, so most people say it means "Super User") This allows you to log in as User "A" and execute commands as User "B" with User "B"'s credentials. This remains active until you log out as User B and return to User A sudo = execute a single command as another user, again this defaults to the root account unless you specify otherwise eg: sudo echo "hello world" password hello world chmod = change permission settings eg: sudo chmod 777 (I could try to explain *nix permissions, but it is easier to look it up. You can do it using letters, but octal notation is quicker once you get used to it) http://en.wikipedia.org/wiki/Unix_permission OK, I'll try. 4=read, 2=write, 1=execute, so 4+2+1=7 (you can do whatever you want to the file) chown = change file/folder ownership settings eg: sudo chown user:group the "man" files provide a good source of info too: eg: man chmod ***************************** OK, now that you're thoroughly confused let's get down to brass tacks. localhost:/ root# cd /directory/that/holds_the_75GB/file localhost:/ root# rm localhost:/ root# ls (notice that the 75GB file *should* be gone) localhost:/ root# shutdown -r now ******************** **edit** I was trying to get the commands correct from memory, then realized I'd screwed up pretty badly and mixed up some Linux with the Mac OS single user mode. Sorry about that. I think that I've fixed it up now. ********************* Re: UNIX/Console question - Glued - 04-17-2007 When I type login, shouldn't the correct response be my login and password from my OSX login? The password is 20 letters/numbers though. Re: UNIX/Console question - ztirffritz - 04-17-2007 sorry, just saw your comments about panics when you try to mount the drive. Can you boot from your backup, mount your internal drive, then delete the file? You do have a backup, right? Right? Re: UNIX/Console question - MacMagus - 04-17-2007 Your description of the command line in Single User Mode does not inspire confidence. Are you sure there isn't anyone else with more experience at the command line who could do this for you? What is the path to the directory and file(s) that you want to get rid of? What command (exactly as you'd type it) were you planning to use to delete that directory and those files? Re: UNIX/Console question - Glued - 04-17-2007 the path would be: Macintosh HD/X DOWNLOADS/DLOADS/filename.eps There's nothing so critical to me in that folder that deleting DLOADS or even X DOWNLOADS would bother me. I understand the usage of "rm filename" to delete files and "rm -r directoryname" to delete directories. It's gaining the privilege to do so without mounting the drive which sends it in a kernel panic (with the oh so funny - not at all - tagline "panic: we are hanging here..."). I've been trying to figure something out for 20+ hours now - I'm fried and probably should wait until morning to try anything new. crud. |