Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

koden

macrumors member
Original poster
Feb 13, 2016
58
5
I have a empty imac

I boot up on my OS disk and open my terminal window

I get this

-bash-3.2#

But no mather what command I type I just get "command not found"

ex. sudo languagesetup

What do I do wrong?
 

MacUser2525

Suspended
Mar 17, 2007
2,097
377
Canada
Perhaps the path is not set correctly. Try using the full path to it sudo /usr/sbin/languagesetup. Also if trying to do an initial setup for the machine then delete the file.

Code:
MacUser2525:~$ ll /var/db/.AppleSetupDone


-r--------  1 root  wheel     0B 24 Dec 16:15 /var/db/.AppleSetupDone

Code:
sudo rm /var/db/.AppleSetupDone

This should get it to run the system setup again like from new install.
 

koden

macrumors member
Original poster
Feb 13, 2016
58
5
Hi thanks for answer

The true story is, that imac is not empty.
I have replaced HD with new SSD disk and installed win10
So there is a OS on the imac.
Just not apple

But I think OS does'nt matter in this issue.
But maybe the HD replacement?
Is something stored on the HD or is terminal commands stored on the imac motherboard?
 

MacUser2525

Suspended
Mar 17, 2007
2,097
377
Canada
Hi thanks for answer

The true story is, that imac is not empty.
I have replaced HD with new SSD disk and installed win10
So there is a OS on the imac.
Just not apple

But I think OS does'nt matter in this issue.
But maybe the HD replacement?
Is something stored on the HD or is terminal commands stored on the imac motherboard?


Well without knowing where the command is run from I have no idea, I had thought it was on a mac. You need to explain exactly what you are doing here for us to be able to help you. If you are in recovery mode and trying to run a command on a machine that does not have the macos on it, it will never find the command you run.
 
  • Like
Reactions: StevePaselli

koden

macrumors member
Original poster
Feb 13, 2016
58
5
Hi

I have an imac with a new SSD disk.
I have installed WIN10 on the disk.
There is no MAC OS.

I boot up the mac from a USB where I have High Sierra.
When I get to the picture where I can install MAC OS i go to the top and open a Terminal.

When the original MAC 1 TB disk was in the imac, I had the same issue with terminal commands.
Commands was'nt working.
There was also no OS on the original disk.

I thought terminal commands could work without a MAC OS on the imac?
I thought terminal was something that was built into bios or whatever :)
 

theluggage

macrumors 604
Jul 29, 2011
7,501
7,385
I thought terminal commands could work without a MAC OS on the imac?
I thought terminal was something that was built into bios or whatever :)

No. Some PCs have something called a 'EFI Shell' (and its probably possible to install one on a Mac) but it's not the same thing as a Unix terminal and wouldn't give you a 'bash' prompt.

How are you "opening a terminal window" without an OS installed?
 

koden

macrumors member
Original poster
Feb 13, 2016
58
5
Ok thanks... yes commands is in OS

terminal is from my USB with high sierra...
When booting from USB or install disc you get MAC help programs like terminal.

I hoped that terminal could find the commands on the installer disc.
 

chrfr

macrumors G5
Jul 11, 2009
13,520
7,043
Ok thanks... yes commands is in OS

terminal is from my USB with high sierra...
When booting from USB or install disc you get MAC help programs like terminal.

I hoped that terminal could find the commands on the installer disc.
The environment on the USB installer is much more limited than the full macOS installation. What are you really trying to do?
 
  • Like
Reactions: millerj123

koden

macrumors member
Original poster
Feb 13, 2016
58
5
remove startup sound which still is there even I run clean windows10 on a SSD disk and have no MAC OS.
 

koden

macrumors member
Original poster
Feb 13, 2016
58
5
  • sudo nvram SystemAudioVolume=%01
  • sudo nvram SystemAudioVolume=%00
  • sudo nvram SystemAudioVolume=” “
  • sudo nvram SystemAudioVolume=%80
but as mentioned I have also tried

sudo languagesetup

sudo rm /var/db/.AppleSetupDone
and others..

always with result: no such command

and my terminal window is not logged in to my user because I don't have a user since there is no OS.

If commands is'nt on USB they don't exist.
I live with the sound :)
 

MacUser2525

Suspended
Mar 17, 2007
2,097
377
Canada
Hi

I have an imac with a new SSD disk.
I have installed WIN10 on the disk.
There is no MAC OS.

I boot up the mac from a USB where I have High Sierra.
When I get to the picture where I can install MAC OS i go to the top and open a Terminal.

When the original MAC 1 TB disk was in the imac, I had the same issue with terminal commands.
Commands was'nt working.
There was also no OS on the original disk.

I thought terminal commands could work without a MAC OS on the imac?
I thought terminal was something that was built into bios or whatever :)


It is in recovery mode you have the terminal you show. But with nothing on the drive to access you will not be able to run a command that requires it to have the files present. Only commands present in the bash shell and the utilities that are there for the use like the mount command, so you can those. If your goal is to have a dual boot with the high sierra and windows 10, the macos on an external drive, then you need to have the drive connected to the mac you will install on. Open disk utility from that screen instead of running Terminal. Making sure that it is partition GUID and AFPS for the formatting then once quitting disk utility run the installer and let it do its job of installing an operating system for you to use.
 
  • Like
Reactions: StevePaselli

koden

macrumors member
Original poster
Feb 13, 2016
58
5
Thanks..

No my goal is to keep windows alone.

I have another imac with MAC OS

I will make a partition and install MAC OS.
And try to remove the sound with terminal
And delete MAC OS afterwards
 

Brian33

macrumors 65816
Apr 30, 2008
1,419
352
USA (Virginia)
I boot up on my OS disk and open my terminal window

I get this

-bash-3.2#

But no mather what command I type I just get "command not found"

ex. sudo languagesetup

What do I do wrong?

If I read this right, you are booting macOS High Sierra from an external USB drive. The terminal prompt -bash-3.2# indicates that you are logged in as the root user (IIRC by convention the '#' character indicates root). So all is good.

First, if you are logged in as root, as I think you are, you don't need to use the 'sudo' command at all -- just leave it off (though it won't hurt to use it).

Second, the commands you want to enter are not "built-in" to the bash processor. So, bash needs to know where to look for the command executables. Normally the PATH environment variable does this. I think your only problem is that the path variable isn't set correctly, so you always get "command not found". I'm not sure why there would be a problem with PATH, but you can work around it by typing the full path to the command execuable file.

The full path to the commands you mentioned are:

/usr/bin/sudo
/usr/sbin/nvram
/usr/sbin/languagesetup
/bin/rm

Nearly every command you would want is in one of these four directories:

/bin
/sbin
/usr/bin
/usr/sbin

So for example /usr/sbin/nvram SystemAudioVolume=%01 should work fine if you're logged in as root, or /usr/bin/sudo /usr/sbin/nvram SystemAudioVolume=%01 if you logged in as an admin user.
 

koden

macrumors member
Original poster
Feb 13, 2016
58
5
thanks for very good explanation :)

I don't know much about unix commands...

But if i'm logged on as root, then I assume the 4 directories commands should work and move me to that directories
And if not the directories is not there?

-bash-3.2# /bin
-bash-3.2# /sbin
-bash-3.2# /usr/bin
-bash-3.2# /usr/sbin
 

MacUser2525

Suspended
Mar 17, 2007
2,097
377
Canada
thanks for very good explanation :)

I don't know much about unix commands...

But if i'm logged on as root, then I assume the 4 directories commands should work and move me to that directories
And if not the directories is not there?

-bash-3.2# /bin
-bash-3.2# /sbin
-bash-3.2# /usr/bin
-bash-3.2# /usr/sbin

Code:
MacUser2525:~$ pwd


/Users/MacUser2525


MacUser2525:~$ cd Documents/


MacUser2525:~/Documents$ cd


MacUser2525:~$ pwd


/Users/MacUser2525

You use the cd command in front of it to change directory, by itself takes you back to the user home directory. That is a built in bash command. For the system commands you need to have mounted the / (root) partition of the install you have to be able to access them in a Terminal in the recovery mode. Unless they are of the commands available in the recovery environment like the mount command I mentioned earlier. For those commands listed you will need to mount the partition for them to work using the path, otherwise the path to them will not be available.

Edit: Once in the directory to run the command you wish you use.

Code:
MacUser2525:/bin$ cd /bin/


MacUser2525:/bin$ ./rm

The ./ tells bash the command is in the current directory no need to use a full path to it.
 
  • Like
Reactions: Brian33

Brian33

macrumors 65816
Apr 30, 2008
1,419
352
USA (Virginia)
Sorry for the confusion -- those aren't commands, just the names of the directories. To "move to" a directory you need the 'cd' command. It looks like that is built into bash. Then, to see what's there you need the 'ls' command.

So for example, try: cd /bin to go to the 'bin' folder, followed by /bin/ls to see what files (commands) are there. If that doesn't work, try /usr/bin/cd /bin instead -- but for some reason that I don't understand /usr/bin/cd doesn't seem to work for me.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,750
8,422
A sea of green
... If that doesn't work, try /usr/bin/cd /bin instead -- but for some reason that I don't understand /usr/bin/cd doesn't seem to work for me.
That's because 'cd' is a shell builtin.

It has to be that way, because if 'cd' is a sub-process, then the directory it sets as current working directory would only apply until the process exited. It would have no effect on later cmds run from the shell.
 
  • Like
Reactions: Brian33
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.