Go to the first, previous, next, last section, table of contents.

Invoking Octave

Normally, Octave is used interactively by running the program `octave' without any arguments. Once started, Octave reads commands from the terminal until you tell it to exit.

You can also specify the name of a file on the command line, and Octave will read and execute the commands from the named file and then exit when it is finished.

You can further control how Octave starts up by using the command-line options described in the next section, and Octave itself can remind you of the options available. Type

octave --help

to display all available options and briefly describe their use (`octave -h' is a shorter equivalent).

Command Line Options

--debug
-d
Enter parser debugging mode. Using this option will cause Octave's parser to print a lot of information about the commands it reads, and is probably only useful if you are actually trying to debug the parser.
--help
-h
-?
Print short help message and exit.
--ignore-init-file
--norc
-f
Don't read any of the system or user initialization files at startup.
--info-file filename
Specify the name of the info file to use. The value of filename specified on the command line will override any value of `OCTAVE_INFO_FILE' found in the environment, but not any `INFO_FILE = "filename"' commands found in the system or user startup files.
--interactive
-i
Force interactive behavior.
--path path
-p path
Specify the path to search for function files. The value of path specified on the command line will override any value of `OCTAVE_PATH' found in the environment, but not any `LOADPATH = "path"' commands found in the system or user startup files.
--silent
--quiet
-q
Don't print message at startup.
--verbose
-V
Turn on verbose output.
--version
-v
Print the program version number and exit.
--echo-commands
-x
Echo commands as they are executed.
file
Execute commands from file.

Startup Files

When Octave starts, it looks for commands to execute from the following files:

OCTAVE_HOME/lib/octave/VERSION/startup/octaverc
Where OCTAVE_HOME is the directory in which all of Octave is installed (the default is `/usr/local'), and VERSION is the version number of Octave. This file is provided so that changes to the default Octave environment can be made globally for all users. Some care should be taken when making changes to this file, since all users of Octave at your site will be affected.
~/.octaverc
This file is normally used to make personal changes to the default Octave environment.
.octaverc
This file can be used to make changes to the default Octave environment for a particular project. Octave searches for this file after it reads `~/.octaverc', so any use of the cd command in the `~/.octaverc' file will affect the directory that Octave searches for the file `.octaverc'. If you start Octave in your home directory, it will avoid executing commands from `~/.octaverc' twice.

A message will be displayed as each of these files is read if you invoke Octave with the --verbose option but without the --silent option.

Startup files may contain any valid Octave commands, including multiple function definitions.


Go to the first, previous, next, last section, table of contents.