How can I start octave from the command line and not the GUI?

I also install through brew I found that just run:

octave-cli

you will see the octave in terminal:

GNU Octave, version 4.2.0-rc2
Copyright (C) 2016 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
    ...
octave:1>

According to here :

octave -W

will force octave to open in CLI. It works for me.


On MacOS, if installed Octave by dmg file, you can add alias to your ~/.bashrc file.

alias octave-cli='/Applications/Octave-4.4.1.app/Contents/Resources/usr/bin/octave-cli'

Then start octave-cli in command line by 'octave-cli'.