19962009 Ericsson AB. All Rights Reserved. The contents of this file are subject to the Erlang Public License, Version 1.1, (the "License"); you may not use this file except in compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. c Joe Armstrong 1 96-10-30 B
c Command Interface Module

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

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

bt(Pid) -> void() Stack backtrace for a process Pid = pid()

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

c(File) -> {ok, Module} | error c(File, Options) -> {ok, Module} | error Compile and load code in a file File = name() -- see filename(3) Options = [Opt] -- see compile:file/2

c/1,2 compiles and then purges and loads the code for a file. Options defaults to []. Compilation is equivalent to:

compile:file(File, Options ++ [report_errors, report_warnings])

Note that purging the code means that any processes lingering in old code for the module are killed without warning. See code/3 for more information.

cd(Dir) -> void() Change working directory Dir = name() -- see filename(3)

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

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

Flushes any messages sent to the shell.

help() -> void() Help information

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

i() -> void() ni() -> void() Information about the system

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

i(X, Y, Z) -> void() Information about pid <X.Y.Z> X = Y = Z = int()

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

l(Module) -> void() Load or reload module Module = atom()

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

Note that purging the code means that any processes lingering in old code for the module are killed without warning. See code/3 for more information.

lc(Files) -> ok Compile a list of files Files = [File]  File = name() -- see filename(3)

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

ls() -> void() List files in the current directory

Lists files in the current directory.

ls(Dir) -> void() List files in a directory Dir = name() -- see filename(3)

Lists files in directory Dir.

m() -> void() Which modules are loaded

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

m(Module) -> void() Information about a module Module = atom()

Displays information about Module.

memory() -> [{Type, Size}] Memory allocation information Type, Size -- see erlang:memory/0

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

memory(Type) -> Size memory([Type]) -> [{Type, Size}] Memory allocation information Type, Size -- see erlang:memory/0

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

nc(File) -> {ok, Module} | error nc(File, Options) -> {ok, Module} | error Compile and load code in a file on all nodes File = name() -- see filename(3) Options = [Opt] -- see compile:file/2

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

compile:file(File, Opts ++ [report_errors, report_warnings])
nl(Module) -> void() Load module on all nodes Module = atom()

Loads Module on all nodes.

pid(X, Y, Z) -> pid() Convert X,Y,Z to a pid X = Y = Z = int()

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

pwd() -> void() Print working directory

Prints the name of the working directory.

q() -> void() Quit - shorthand for init:stop()

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

regs() -> void() nregs() -> void() Information about registered processes

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

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

This function 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() -- see filename(3) YeccRet = -- see yecc:file/2

Generates an LALR-1 parser. Equivalent to:

yecc:file(File)
y(File, Options) -> YeccRet Generate an LALR-1 parser File = name() -- see filename(3) Options, YeccRet = -- see yecc:file/2

Generates an LALR-1 parser. Equivalent to:

yecc:file(File, Options)
See Also

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