Wolfram System File Organization

Wolfram System Distribution Files

A full Wolfram System installation consists of thousands of separate files, arranged in several hundred directories under the main installation directory. The location of the main installation directory is determined at install time. From within a Wolfram Language kernel, its name is given by the value of (RefLink[$InstallationDirectory, paclet:ref/$InstallationDirectory]).

Default locations for the Wolfram System installation directory.

The executable programs that launch the Wolfram System are typically in the main installation directory. Sometimes there may also be links to them, or scripts accessing them, in other locations. From within a Wolfram Language kernel, (RefLink[First, paclet:ref/First])[(RefLink[$CommandLine, paclet:ref/$CommandLine])] gives the full name of the executable program corresponding to that kernel.

Typical executable programs accessible from the installation directory.

The main installation directory has three standard subdirectories that contain material distributed with the Wolfram System. Under normal circumstances, none of the contents of these directories should ever be modified, except, for example, if you choose to edit a shared stylesheet.

Top-level subdirectories of the main installation directory.

Particularly on Linux systems, the Wolfram System often has executable files for different computer architectures and systems stored in a single overall directory structure. Each system is in a subdirectory with a name given by (RefLink[$SystemID, paclet:ref/$SystemID]). Some resource directories may also contain files specific both to particular languages and particular computing environments. These files are given in subdirectories such as Japanese/Windows.

Typical subdirectories of the SystemFiles directory, part one.

Typical subdirectories of the SystemFiles directory, part two.

Files of information to be displayed by the Wolfram System Help Viewer are stored in the Documentation directory.

Typical subdirectories of the Documentation directory.

Loadable Files

You can customize your Wolfram System by adding files that can be loaded into the system under different circumstances. Such files are conventionally placed in either systemwide or user-specific base directories.

Base directories for files to be loaded by the Wolfram System.

Typical values of (RefLink[$BaseDirectory, paclet:ref/$BaseDirectory]).

Typical values of (RefLink[$UserBaseDirectory, paclet:ref/$UserBaseDirectory]).

You can specify different locations for these directories by setting operating system environment variables when you launch the Wolfram System, as discussed in "Wolfram System Sessions".

Typical subdirectories of Wolfram System base directories.

Some files in base directories serve as configuration files, automatically used by the Wolfram Language kernel or front end.

Some typical kernel and front end configuration files.

Kernel configuration files can contain any Wolfram Language commands. These commands can test global variables such as (RefLink[$SystemID, paclet:ref/$SystemID]) and (RefLink[$MachineName, paclet:ref/$MachineName]) to determine what operations to perform. Front end configuration files can contain only certain special commands, as described in "Input Syntax".

Subdirectories under (RefLink[$BaseDirectory, paclet:ref/$BaseDirectory]) and (RefLink[$UserBaseDirectory, paclet:ref/$UserBaseDirectory]).

With the default setting for the kernel (RefLink[$Path, paclet:ref/$Path]) variable, an add-on can be loaded from within a Wolfram System session simply by using the command <<name`. This will load the init.m file for the add-on, which should in turn be set up to load other necessary files or packages.

By placing an add-on under the Autoload subdirectory of (RefLink[$BaseDirectory, paclet:ref/$BaseDirectory]) or (RefLink[$UserBaseDirectory, paclet:ref/$UserBaseDirectory]), you can have the Wolfram System automatically load the add-on whenever you start the kernel or the front end.

Typical possible contents of the directory for an add-on.