Go Back   MacRumors Forums > Apple Systems and Services > OS X

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 17, 2009, 11:48 AM   #1
pieman69
macrumors newbie
 
Join Date: Oct 2009
Single User Mode command list

I've stupidly moved (not deleted) a couple of shortcut links to items in the 'private' folder, from their correct place resulting in my Macbook Pro (10.5) refusing to boot.

The files were resident in the top level of the Macintosh HD after enabling the viewing of hidden files using console. I created a new folder at the same level and moved the files into it.

Problem is I cant remember the specific file names that i moved - though it was only a couple )!!

I have started up in single user mode and know the commands for moving files around, but need to be able to view the folder/file structure of the disk.

Is there a command usable from Single User interface that would list the files/folder structure?
pieman69 is offline   0 Reply With Quote
Old Oct 17, 2009, 12:13 PM   #2
calderone
macrumors 68040
 
calderone's Avatar
 
Join Date: Aug 2009
Location: Seattle
It actually tells you how to do it right above the prompt.

Run
Code:
fsck -y
then

Code:
mount -uw /
calderone is offline   0 Reply With Quote
Old Oct 17, 2009, 12:38 PM   #3
pieman69
Thread Starter
macrumors newbie
 
Join Date: Oct 2009
Thanks for the reply.

I can mount the disk without a problem using the 'mount -uw' prompt, however what i need is effectively a list of the folders/subfolders on the disk.
without this information i am unable to identify which files i need to recover.

Once i can see the folder/file list i will know straight away which they are.
It was only 2 files that i moved. the 'var' and 'etc' i think, but not 100% sure.
pieman69 is offline   0 Reply With Quote
Old Oct 17, 2009, 12:53 PM   #4
calderone
macrumors 68040
 
calderone's Avatar
 
Join Date: Aug 2009
Location: Seattle
You can use any unix commands.

But here are a few that should help you a bit.

ls will list the directories and files relative to where you are.

cd xxx will allow you to change directories. For example cd var (if you are in the root) and cd /var if you are elsewhere.

mv will allow to you move files. For example:
mv /var/myfile /users/shortname/myfile

That will move the file from var to the root of your home folder.

Since it sound like you will be working in system directories, you will need to add sudo before a command that will manipulate files.

So you would need to use if before the mv command, but not cd or ls.

Hope that helps.
calderone is offline   0 Reply With Quote
Old Oct 17, 2009, 01:03 PM   #5
Darth.Titan
macrumors 68020
 
Darth.Titan's Avatar
 
Join Date: Oct 2007
sudo isn't necessary in single-user mode. In single user mode you are effectively logged in as root.

The other commands mentioned will probably be useful, but the original request to view file structure can be achieved with the ls command. you'll probably want detailed listings to view permissions, ownership, etc. so ls -la is probably your best bet.

If there are too many files/directories to view on one screen ls -la | more should do the trick. That will pause the listing a screen at a time and you can advance to the next screen with the spacebar. don't forget to brush up on any of these commands with man <command>

You should probably prepare yourself to use your install disc for a clean install to fix things though.
Darth.Titan is offline   0 Reply With Quote
Old Oct 17, 2009, 01:11 PM   #6
calderone
macrumors 68040
 
calderone's Avatar
 
Join Date: Aug 2009
Location: Seattle
Quote:
Originally Posted by Darth.Titan View Post
sudo isn't necessary in single-user mode. In single user mode you are effectively logged in as root.

The other commands mentioned will probably be useful, but the original request to view file structure can be achieved with the ls command. you'll probably want detailed listings to view permissions, ownership, etc. so ls -la is probably your best bet.

If there are too many files/directories to view on one screen ls -la | more should do the trick. That will pause the listing a screen at a time and you can advance to the next screen with the spacebar. don't forget to brush up on any of these commands with man <command>

You should probably prepare yourself to use your install disc for a clean install to fix things though.
Forgot you don't need sudo. I did mention ls though, although not a detailed.
calderone is offline   0 Reply With Quote
Old Oct 17, 2009, 05:14 PM   #7
pieman69
Thread Starter
macrumors newbie
 
Join Date: Oct 2009
Thanks for all the advice.

I will be giving it a go tomorrow and keep you posted.

Cheers
pieman69 is offline   0 Reply With Quote
Old Dec 23, 2011, 11:57 AM   #8
GreenSleeve
macrumors newbie
 
Join Date: Dec 2011
Quote:
Originally Posted by pieman69 View Post
I've stupidly moved (not deleted) a couple of shortcut links to items in the 'private' folder, from their correct place resulting in my Macbook Pro (10.5) refusing to boot.

The files were resident in the top level of the Macintosh HD after enabling the viewing of hidden files using console. I created a new folder at the same level and moved the files into it.

Problem is I cant remember the specific file names that i moved - though it was only a couple )!!

I have started up in single user mode and know the commands for moving files around, but need to be able to view the folder/file structure of the disk.

Is there a command usable from Single User interface that would list the files/folder structure?
I have a similar issue. In 'get info' I unlocked and 'applied to all' in some folders that I should not have, now I can't boot. Stuck on gray screen with logo. Used some fsck commands and it appeared all the files were ok but still no startup. Any suggestions?
GreenSleeve is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
How to get into single user mode on new macbook air Pie13 Mac Basics and Help 11 Oct 16, 2013 04:40 AM
Disabling Single User Mode 10.6.8 Macman671 Mac Basics and Help 3 Oct 15, 2013 10:15 AM
Single user mode in MAC OS X omni1787 OS X 5 Mar 21, 2013 12:07 PM
G5 20" iMac won't go in single user mode KAyBooGiie iMac 2 Nov 10, 2012 01:27 AM
single user mode display identification command needed retinalcircus Mac Programming 0 Jul 14, 2012 06:37 PM

Forum Jump

All times are GMT -5. The time now is 10:06 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC