Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 19, 2013, 01:00 PM   #1
sun surfer
macrumors regular
 
Join Date: Jun 2010
Nicl: command not found (how to replace it? trying to erase user)

Hi, I've erased my MacBook Pro, re-installed the Snow Leopard OS X and added some applications with a temporary user and am attempting to erase that user so the computer will be "like new". I don't know a lot about this stuff but I found these instructions for the end:

Code:
Software must be installed into root level applications folder (/applications and not ~/applications).

Reboot and hold down command-s.

Enter:
/sbin/fsck -y
/sbin/mount -uw /

Then to delete user account used to install applications:
rm -r /Users/[user's short name]
nicl -raw /var/db/netinfo/local.nidb delete /users/[user's short name]

Then to make machine start set-up assistant again:
rm /var/db/.AppleSetupDone

Then to shut down:
shutdown -h now
Everything worked fine except the line beginning with "nicl". That line brought the response "-sh: nicl: command not found".

I started the machine up again and there was no user, so I created a new one and tried it all again with the new user, and the same thing with the "nicl" line. Again I started it and there was no user, so I'm thinking the line above the "nicl" might erase the user from sight, but the "nicl" line that's actually supposed to erase the user isn't working so those users I've created might be hiding somewhere.

I googled and found that "nicl" and "netinfo" might only work on Leopard and earlier, and that "dscl" might replace it.

How would the line be written with "dscl" instead to make it work to erase a user, or is there some other command that would work?
sun surfer is offline   0 Reply With Quote
Old Jul 19, 2013, 01:15 PM   #2
lee1210
macrumors 68040
 
lee1210's Avatar
 
Join Date: Jan 2005
Location: Dallas, TX
nidb appears, but not nicl. Are you manually typing commands?

-Lee
lee1210 is offline   0 Reply With Quote
Old Jul 19, 2013, 01:26 PM   #3
chrfr
macrumors 68020
 
Join Date: Jul 2009
dscl replaced nicl a long time ago but the syntax is different. Macs don't use Netinfo anymore, and haven't since 10.4.
The entire process to do what you want is different, and longer:
http://hints.macworld.com/article.ph...21202080339900
chrfr is offline   0 Reply With Quote
Old Jul 19, 2013, 01:35 PM   #4
sun surfer
Thread Starter
macrumors regular
 
Join Date: Jun 2010
Quote:
Originally Posted by lee1210 View Post
nidb appears, but not nicl. Are you manually typing commands?

-Lee
Nidb?

Yes, I'm typing commands into the "root" screen, I think it's called? I restart with command-s and it takes me to a terminal-like black screen where I type in commands.

----------

Quote:
Originally Posted by chrfr View Post
dscl replaced nicl a long time ago but the syntax is different. Macs don't use Netinfo anymore, and haven't since 10.4.
The entire process to do what you want is different, and longer:
http://hints.macworld.com/article.ph...21202080339900
Thanks! That's the type of thing I was looking for. I will try it and hopefully it all works, and I guess I'll have to try it for all the usernames I created to make sure they're all gone even though they seem disappeared for now.
sun surfer is offline   0 Reply With Quote
Old Jul 19, 2013, 02:01 PM   #5
sun surfer
Thread Starter
macrumors regular
 
Join Date: Jun 2010
OK, that link to new directions is not working correctly.

First of all, all its directions start with "$". Why is this? Do I have to put those in? I'm assuming not because I've seen similar directions without the "$". My screen doesn't show a "$" to start every line but rather something that includes the word "root".

OK, the first problem from that link is with this command:

Code:
$ launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
My computer says something like that is not found and that I should instead use something very similar but with something like "com.apple.DirectoryServices.plist" instead, followed by "localonly" or something. So I did, and this still said nothing was found but now took me out the line where it always began with "root" something and to a line that only begins with ">".

I then tried the next line of command:

Code:
$ dscl . -read /Users/USERNAME GeneratedUID
and all it does is give me this really long list of possible commands to use (so long the top is cut off by the screen and I have no idea how to scroll up to see the top).

So that's where I'm stuck at now. I read some of the comments from the link before trying and they all say how it works well if they used it, so how is this happening to me? I'm following the instructions closely and wrote everything exactly as told to do.


ETA - That link mentions Lion and Mountain Lion. I assumed since chrfr linked me and since Snow Leopard is included with those as the "post-nicl" os xs, that they would work the same way with Snow Leopard. But now I'm wondering if those commands are only for Lion/Mountain Lion. If so, what will work for Snow Leopard?
sun surfer is offline   0 Reply With Quote
Old Jul 19, 2013, 03:15 PM   #6
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
$ or > are commonly used to represent prompt, which may look like whatever you program it to look like.

The default shell in Terminal is, I think, Bash, which normally includes the user name, the current directory, and a > in the prompt.
__________________
Don't tell me Macs don't last: 2007 iMac, 2007 Mac Mini, 2008 MacBook Air, all Vintage.
(iMac obsoletion: April 28, 2015, MBA: October 14, 2015, Mac Mini: March 9, 2016)
ArtOfWarfare is offline   0 Reply With Quote
Old Jul 19, 2013, 03:18 PM   #7
chown33
macrumors 603
 
Join Date: Aug 2009
Don't type the $ .

When they show the $, that's the prompt. You're supposed to type what comes after the $ .


When you say "I found instructions ..." it's always a good idea to post where you found them. That is, post the exact URL of what you're referring to.

Like if you said "I read in a book ...", it's a good idea to tell us what the title and author of the book is. So we're all reading from the same book.

----------

Quote:
Originally Posted by ArtOfWarfare View Post
The default shell in Terminal is, I think, Bash, which normally includes the user name, the current directory, and a > in the prompt.
No, the default prompt contains name, directory, and $ as the end of the prompt.

The > prompt means a continuation line, like an unclosed quote, or a previous line ending with backslash-newline.

And the default prompt when running as the root user is # .
chown33 is offline   0 Reply With Quote
Old Jul 19, 2013, 03:47 PM   #8
sun surfer
Thread Starter
macrumors regular
 
Join Date: Jun 2010
Quote:
Originally Posted by chown33 View Post
Don't type the $ .

When they show the $, that's the prompt. You're supposed to type what comes after the $ .


When you say "I found instructions ..." it's always a good idea to post where you found them. That is, post the exact URL of what you're referring to.

Like if you said "I read in a book ...", it's a good idea to tell us what the title and author of the book is. So we're all reading from the same book.[COLOR="#808080"]
Thanks for the "$" explanation.

I honestly don't know where I found those instructions. Days ago I went looking for instructions on the entire process of erasing a computer to make it like new, and those were just one. I copied and pasted them into a Pages document along with others, then decided to use those for the endgame because they were a way to add back the applications and still have the laptop start like new. I just now tried googling for them using some of the commands in quotations but it's not showing up on google so I don't know. But suffice it to say, I copied the important parts here, and they all worked except that one line, and it's already been established that the one line is too old, from 10.4 and before while I'm using 10.6. So now the issue is finding some other commands to work.

However, the instructions I was just trying today that aren't working were from the link that chrfr gave me above from the macworld article. Those aren't working right but they're way too long to copy and paste in full so you can click on the link to see the full instructions I was working from, but I did paste the relevant commands when they stopped working. My guess is that the problem is that those instructions are for 10.7 and above, while the old instructions from the first post of mine are from 10.4 and below, which basically leaves correct instructions for my 10.6 in the dust.

I went searching some more and did finally find this not long ago:http://forums.macrumors.com/showthread.php?t=1140591

Specifically the last post there (4), which is apparently some instructions for the same thing for 10.6. I just tried them and they sort of seem to work. But I've already done so much other, I'm not sure (like some things were already erased beforehand). The "launchctrl" command worked properly

Code:
$ /bin/launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
unlike with the linked instructions from chrfr.

And then this command seemed to work the first time:

Code:
$ dscl . -delete /Groups/admin GroupMembership <username>
Which is good, since I used the username of one of the users that had "disappeared" using the directions in my first post, so it was good to know it was hiding somewhere and is now gone.

However, when I tried it for the other users, it didn't work, just saying the directory is already loaded. So my best guess is that hopefully, that command erased all the admin users and not just the one username I added at the end of the line.

I did run this line first too from the last link:

Code:
$ rm -R /Library/Preferences/
Which wasn't in either of the other sets of directions. Hopefully it won't mess anything up; I'm just guessing it's erasing library preferences in case I set any while using a temporary user to install applications.

So, basically, I'm still sort of lost as to what to do exactly with all these competing instructions and none working exactly right, but the feeling I'm getting is that maybe I've now done enough and basically the users are deleted and it's good to go?
sun surfer is offline   0 Reply With Quote
Old Jul 19, 2013, 05:47 PM   #9
chrfr
macrumors 68020
 
Join Date: Jul 2009
I dug out my own notes on this. Your guess is correct:
/System/Library/LaunchDaemons/com.apple.DirectoryServices.plist is on Leopard and Snow Leopard while Lion and later use /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist.

So for Leopard and Snow Leopard, do the following:
First, boot into Single User Mode. Then type each of the following lines into the prompt.
Code:
mount -uw /
rm -R /Library/Preferences

rm -R /Users/username/

rm /var/db/.AppleSetupDone

/bin/launchctl load 

/System/Library/LaunchDaemons/com.apple.DirectoryServices.plist &

dscl . -delete /Users/username

dscl . -delete /Groups/admin GroupMembership username

shutdown -h now
chrfr is offline   0 Reply With Quote
Old Jul 19, 2013, 10:56 PM   #10
sun surfer
Thread Starter
macrumors regular
 
Join Date: Jun 2010
Thanks chrfr. That's similar to what I did from the last link I included and now when I try it, it's acting like there is nothing there to delete at that part. Iinstead of seeming to run the delete commands, it's just saying that the directory is already loaded so I'm assuming that means there's nothing there to delete now?
sun surfer is offline   0 Reply With Quote
Old Jul 20, 2013, 08:42 AM   #11
chrfr
macrumors 68020
 
Join Date: Jul 2009
Quote:
Originally Posted by sun surfer View Post
Thanks chrfr. That's similar to what I did from the last link I included and now when I try it, it's acting like there is nothing there to delete at that part. Iinstead of seeming to run the delete commands, it's just saying that the directory is already loaded so I'm assuming that means there's nothing there to delete now?
If you've already loaded Directory Services and haven't rebooted since, you do not need to reload it. With Directory Services loaded, you can type the following to see if that user is there. You will get a long list of names but near the bottom would be the accounts you created.
Code:
dscl . -list /Users
chrfr is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
No way to erase user name and password in Safari 6 bostich OS X 3 Nov 30, 2013 11:22 AM
media: command not found frenzen OS X Mavericks (10.9) 1 Oct 16, 2013 07:57 PM
Terminal on Install DVD - command not found madmac66 OS X 6 Feb 10, 2013 03:18 AM
single user mode display identification command needed retinalcircus Mac Programming 0 Jul 14, 2012 05:37 PM
-bash: .: command not found sbaha OS X 1 Jun 2, 2012 12:34 AM

Forum Jump

All times are GMT -5. The time now is 03:22 PM.

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

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