19962016 Ericsson AB. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. c Joe Armstrong 1 1996-10-30 B
c Command interface module.

This module enables users to enter the short form of some commonly used commands.

These functions are intended for interactive use in the Erlang shell only. The module prefix can be omitted.

Stack backtrace for a process.

Stack backtrace for a process. Equivalent to erlang:process_display(Pid, backtrace).

Compile and load a file or module.

Compiles and then purges and loads the code for a module. Module can be either a module name or a source file path, with or without .erl extension. Options defaults to [].

If Module is an atom and is not the path of a source file, then the code path is searched to locate the object file for the module and extract its original compiler options and source path. If the source file is not found in the original location, filelib:find_source/1 is used to search for it relative to the directory of the object file.

The source file is compiled with the the original options appended to the given Options, the output replacing the old object file if and only if compilation succeeds. A function Filter can be specified for removing elements from from the original compiler options before the new options are added.

Notice that purging the code means that any processes lingering in old code for the module are killed without warning. For more information, see code/3.

Change working directory.

Changes working directory to Dir, which can be a relative name, and then prints the name of the new working directory.

Example:

2> cd("../erlang").
/home/ron/erlang
Flush any messages sent to the shell.

Flushes any messages sent to the shell.

Help information.

Displays help information: all valid shell internal commands, and commands in this module.

System information.

i/0 displays system information, listing information about all processes. ni/0 does the same, but for all nodes the network.

Information about pid <X.Y.Z>.

Displays information about a process, Equivalent to process_info(pid(X, Y, Z)), but location transparent.

Load or reload a module.

Purges and loads, or reloads, a module by calling code:purge(Module) followed by code:load_file(Module).

Notice that purging the code means that any processes lingering in old code for the module are killed without warning. For more information, see code/3.

lc(Files) -> ok Compile a list of files. Files = [File] File

Compiles a list of files by calling compile:file(File, [report_errors, report_warnings]) for each File in Files.

For information about File, see file:filename().

Loads all modified modules.

Reloads all currently loaded modules that have changed on disk (see mm()). Returns the list of results from calling l(M) for each such M.

List files in the current directory.

Lists files in the current directory.

List files in a directory or a single file.

Lists files in directory Dir or, if Dir is a file, only lists it.

Which modules are loaded.

Displays information about the loaded modules, including the files from which they have been loaded.

Information about a module.

Displays information about Module.

Lists all modified modules.

Lists all modified modules. Shorthand for code:modified_modules/0.

Memory allocation information.

Memory allocation information. Equivalent to erlang:memory/0.

Memory allocation information.

Memory allocation information. Equivalent to erlang:memory/1.

Compile and load code in a file on all nodes.

Compiles and then loads the code for a file on all nodes. Options defaults to []. Compilation is equivalent to:

compile:file(File, Options ++ [report_errors, report_warnings])
Load module on all nodes.

Loads Module on all nodes.

Convert X,Y,Z to a pid.

Converts X, Y, Z to pid ]]>. This function is only to be used when debugging.

Print working directory.

Prints the name of the working directory.

Quit - shorthand for init:stop().

This function is shorthand for init:stop(), that is, it causes the node to stop in a controlled fashion.

Information about registered processes.

regs/0 displays information about all registered processes. nregs/0 does the same, but for all nodes in the network.

Print node uptime.

Prints the node uptime (as specified by erlang:statistics(wall_clock)) in human-readable form.

xm(ModSpec) -> void() Cross-reference check a module. ModSpec = Module | Filename  Module = atom()  Filename = string()

Finds undefined functions, unused functions, and calls to deprecated functions in a module by calling xref:m/1.

y(File) -> YeccRet Generate an LALR-1 parser. File = name() YeccRet

Generates an LALR-1 parser. Equivalent to:

yecc:file(File)

For information about File = name(), see filename(3). For information about YeccRet, see yecc:file/2.

y(File, Options) -> YeccRet Generate an LALR-1 parser. File = name() Options, YeccRet

Generates an LALR-1 parser. Equivalent to:

yecc:file(File, Options)

For information about File = name(), see filename(3). For information about Options and YeccRet, see yecc:file/2.

See Also

filename(3), compile(3), erlang(3), yecc(3), xref(3)