Command interface module.
This module enables users to enter the short form of some commonly used commands.
Note!
These functions are intended for interactive use in the Erlang shell only. The module prefix can be omitted.
Functions
bt(Pid) -> ok | undefined
Pid = pid()
Stack backtrace for a process. Equivalent to
erlang:process_display(
.
c(Module) -> {ok, ModuleName} | error
Module = file:name()
ModuleName = module()
c(Module, Options) -> {ok, ModuleName} | error
Module = file:name()
Options = [compile:option()] | compile:option()
ModuleName = module()
c(Module, Options, Filter) -> {ok, ModuleName} | error
Module = atom()
Options = [compile:option()]
Filter = fun((compile:option()) -> boolean())
ModuleName = module()
Compiles and then purges and loads the code for a module.
can be either a module name or a source
file path, with or without .erl
extension.
defaults to []
.
If
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
, the
output replacing the old object file if and only if compilation
succeeds. A function
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
.
cd(Dir) -> ok
Dir = file:name()
Changes working directory to
, which can be a
relative name, and then prints the name of the new working
directory.
Example:
2> cd("../erlang").
/home/ron/erlang
erlangrc(PathList) -> {ok, file:filename()} | {error, term()}
PathList = [Dir :: file:name()]
Search PathList
and load .erlang
resource file if
found.
flush() -> ok
Flushes any messages sent to the shell.
help() -> ok
Displays help information: all valid shell internal commands, and commands in this module.
i() -> ok
ni() -> ok
i/0
displays system information, listing
information about all processes. ni/0
does the same,
but for all nodes the network.
i(X, Y, Z) -> [{atom(), term()}]
X = Y = Z = integer() >= 0
Displays information about a process, Equivalent to
process_info(pid(
, but location transparent.
l(Module) -> code:load_ret()
Module = module()
Purges and loads, or reloads, a module by calling
code:purge(
followed by
code:load_file(
.
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
.
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()
.
lm() -> [code:load_ret()]
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
.
ls() -> ok
Lists files in the current directory.
m() -> ok
Displays information about the loaded modules, including the files from which they have been loaded.
m(Module) -> ok
Module = module()
Displays information about
.
mm() -> [module()]
Lists all modified modules. Shorthand for
code:modified_modules/0
.
memory() -> [{Type, Size}]
Type = atom()
Size = integer() >= 0
Memory allocation information. Equivalent to
erlang:memory/0
.
nc(File) -> {ok, Module} | error
File = file:name()
Module = module()
nc(File, Options) -> {ok, Module} | error
File = file:name()
Options = [Option] | Option
Option = compile:option()
Module = module()
Compiles and then loads the code for a file on all nodes.
defaults to []
.
Compilation is equivalent to:
compile:file(File ,Options ++ [report_errors, report_warnings])
nl(Module) -> abcast | error
Module = module()
Loads
on all nodes.
pid(X, Y, Z) -> pid()
X = Y = Z = integer() >= 0
Converts
,
,
to pid <X.Y.Z>
.
This function is only to be used when debugging.
pwd() -> ok
Prints the name of the working directory.
q() -> no_return()
This function is shorthand for init:stop()
, that is,
it causes the node to stop in a controlled fashion.
regs() -> ok
nregs() -> ok
regs/0
displays information about all registered
processes. nregs/0
does the same, but for all nodes
in the network.
uptime() -> ok
Prints the node uptime (as specified by
erlang:statistics(wall_clock)
) in human-readable form.
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
.
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
.
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
.