1
<?xml version="1.0" encoding="latin1" ?>
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
9
<holder>Ericsson AB, All Rights Reserved</holder>
12
The contents of this file are subject to the Erlang Public License,
13
Version 1.1, (the "License"); you may not use this file except in
14
compliance with the License. You should have received a copy of the
15
Erlang Public License along with this software. If not, it can be
16
retrieved online at http://www.erlang.org/.
18
Software distributed under the License is distributed on an "AS IS"
19
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
20
the License for the specific language governing rights and limitations
23
The Initial Developer of the Original Code is Ericsson AB.
27
<prepared>Joe Armstrong</prepared>
33
<modulesummary>Command Interface Module</modulesummary>
35
<p>The <c>c</c> module enables users to enter the short form of
36
some commonly used commands.</p>
38
<p>These functions are are intended for interactive use in
39
the Erlang shell only. The module prefix may be omitted.</p>
44
<name>bt(Pid) -> void()</name>
45
<fsummary>Stack backtrace for a process</fsummary>
50
<p>Stack backtrace for a process. Equivalent to
51
<c>erlang:process_display(Pid, backtrace)</c>.</p>
55
<name>c(File) -> {ok, Module} | error</name>
56
<name>c(File, Options) -> {ok, Module} | error</name>
57
<fsummary>Compile and load code in a file</fsummary>
59
<v>File = name() -- see filename(3)</v>
60
<v>Options = [Opt] -- see compile:file/2</v>
63
<p><c>c/1,2</c> compiles and then purges and loads the code for
64
a file. <c>Options</c> defaults to []. Compilation is
67
compile:file(File, Options ++ [report_errors, report_warnings])</code>
68
<p>Note that purging the code means that any processes
69
lingering in old code for the module are killed without
70
warning. See <c>code/3</c> for more information.</p>
74
<name>cd(Dir) -> void()</name>
75
<fsummary>Change working directory</fsummary>
77
<v>Dir = name() -- see filename(3)</v>
80
<p>Changes working directory to <c>Dir</c>, which may be a
81
relative name, and then prints the name of the new working
84
2> <input>cd("../erlang").</input>
85
/home/ron/erlang</pre>
89
<name>flush() -> void()</name>
90
<fsummary>Flush any messages sent to the shell</fsummary>
92
<p>Flushes any messages sent to the shell.</p>
96
<name>help() -> void()</name>
97
<fsummary>Help information</fsummary>
99
<p>Displays help information: all valid shell internal commands,
100
and commands in this module.</p>
104
<name>i() -> void()</name>
105
<name>ni() -> void()</name>
106
<fsummary>Information about the system</fsummary>
108
<p><c>i/0</c> displays information about the system, listing
109
information about all processes. <c>ni/0</c> does the same,
110
but for all nodes the network.</p>
114
<name>i(X, Y, Z) -> void()</name>
115
<fsummary>Information about pid <X.Y.Z></fsummary>
117
<v>X = Y = Z = int()</v>
120
<p>Displays information about a process, Equivalent to
121
<c>process_info(pid(X, Y, Z))</c>, but location transparent.</p>
125
<name>l(Module) -> void()</name>
126
<fsummary>Load or reload module</fsummary>
128
<v>Module = atom()</v>
131
<p>Purges and loads, or reloads, a module by calling
132
<c>code:purge(Module)</c> followed by
133
<c>code:load_file(Module)</c>.</p>
134
<p>Note that purging the code means that any processes
135
lingering in old code for the module are killed without
136
warning. See <c>code/3</c> for more information.</p>
140
<name>lc(Files) -> ok</name>
141
<fsummary>Compile a list of files</fsummary>
143
<v>Files = [File]</v>
144
<v> File = name() -- see filename(3)</v>
147
<p>Compiles a list of files by calling <c>compile:file(File, [report_errors, report_warnings])</c> for each <c>File</c>
152
<name>ls() -> void()</name>
153
<fsummary>List files in the current directory</fsummary>
155
<p>Lists files in the current directory.</p>
159
<name>ls(Dir) -> void()</name>
160
<fsummary>List files in a directory</fsummary>
162
<v>Dir = name() -- see filename(3)</v>
165
<p>Lists files in directory <c>Dir</c>.</p>
169
<name>m() -> void()</name>
170
<fsummary>Which modules are loaded</fsummary>
172
<p>Displays information about the loaded modules, including
173
the files from which they have been loaded.</p>
177
<name>m(Module) -> void()</name>
178
<fsummary>Information about a module</fsummary>
180
<v>Module = atom()</v>
183
<p>Displays information about <c>Module</c>.</p>
187
<name>memory() -> [{Type, Size}]</name>
188
<fsummary>Memory allocation information</fsummary>
190
<v>Type, Size -- see erlang:memory/0</v>
193
<p>Memory allocation information. Equivalent to
194
<c>erlang:memory/0</c>.</p>
198
<name>memory(Type) -> Size</name>
199
<name>memory([Type]) -> [{Type, Size}]</name>
200
<fsummary>Memory allocation information</fsummary>
202
<v>Type, Size -- see erlang:memory/0</v>
205
<p>Memory allocation information. Equivalent to
206
<c>erlang:memory/1</c>.</p>
210
<name>nc(File) -> {ok, Module} | error</name>
211
<name>nc(File, Options) -> {ok, Module} | error</name>
212
<fsummary>Compile and load code in a file on all nodes</fsummary>
214
<v>File = name() -- see filename(3)</v>
215
<v>Options = [Opt] -- see compile:file/2</v>
218
<p>Compiles and then loads the code for a file on all nodes.
219
<c>Options</c> defaults to []. Compilation is equivalent to:</p>
221
compile:file(File, Opts ++ [report_errors, report_warnings])</code>
225
<name>nl(Module) -> void()</name>
226
<fsummary>Load module on all nodes</fsummary>
228
<v>Module = atom()</v>
231
<p>Loads <c>Module</c> on all nodes.</p>
235
<name>pid(X, Y, Z) -> pid()</name>
236
<fsummary>Convert X,Y,Z to a pid</fsummary>
238
<v>X = Y = Z = int()</v>
241
<p>Converts <c>X</c>, <c>Y</c>, <c>Z</c> to the pid
242
<c><![CDATA[<X.Y.Z>]]></c>. This function should only be used when
247
<name>pwd() -> void()</name>
248
<fsummary>Print working directory</fsummary>
250
<p>Prints the name of the working directory.</p>
254
<name>q() -> void()</name>
255
<fsummary>Quit - shorthand for <c>init:stop()</c></fsummary>
257
<p>This function is shorthand for <c>init:stop()</c>, that is,
258
it causes the node to stop in a controlled fashion.</p>
262
<name>regs() -> void()</name>
263
<name>nregs() -> void()</name>
264
<fsummary>Information about registered processes</fsummary>
266
<p><c>regs/0</c> displays information about all registered
267
processes. <c>nregs/0</c> does the same, but for all nodes
272
<name>xm(ModSpec) -> void()</name>
273
<fsummary>Cross reference check a module</fsummary>
275
<v>ModSpec = Module | Filename</v>
276
<v> Module = atom()</v>
277
<v> Filename = string()</v>
280
<p>This function finds undefined functions, unused functions,
281
and calls to deprecated functions in a module by calling
286
<name>y(File) -> YeccRet</name>
287
<fsummary>Generate an LALR-1 parser</fsummary>
289
<v>File = name() -- see filename(3)</v>
290
<v>YeccRet = -- see yecc:file/2</v>
293
<p>Generates an LALR-1 parser. Equivalent to:</p>
295
yecc:file(File)</code>
299
<name>y(File, Options) -> YeccRet</name>
300
<fsummary>Generate an LALR-1 parser</fsummary>
302
<v>File = name() -- see filename(3)</v>
303
<v>Options, YeccRet = -- see yecc:file/2</v>
306
<p>Generates an LALR-1 parser. Equivalent to:</p>
308
yecc:file(File, Options)</code>
314
<title>See Also</title>
315
<p><seealso marker="compiler:compile">compile(3)</seealso>,
316
<seealso marker="filename">filename(3)</seealso>,
317
<seealso marker="kernel:erlang">erlang(3)</seealso>,
318
<seealso marker="parsetools:yecc">yecc(3)</seealso>,
319
<seealso marker="tools:xref">xref(3)</seealso></p>