Eshell入门【1】

在erlang的bin目录下有个erl,是个软链接,指向 ../lib/erlang/bin/erl

退出Eshell的n种方法

方法一 ctrl+g
-bash-3.2$ erl
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
 
Eshell V5.9.2  (abort with ^G)
 
1> %敲按键 ctrl+g,这是根据上面Eshell自己的提示   (abort with ^G) 来的,然后再敲q ,回车,就行了。
1>
User switch command
--> h
  c [nn]            - connect to job
  i [nn]            - interrupt job
  k [nn]            - kill job
  j                 - list all jobs
  s [shell]         - start local shell
  r [node [shell]]  - start remote shell
  q        - quit erlang
  ? | h             - this message
-->q
-bash-3.2$
方法二:q()
-bash-3.2$ erl
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
 
Eshell V5.9.2  (abort with ^G)
1> q().
ok
2> -bash-3.2$
 
方法三:halt()
-bash-3.2$ erl -sname yeq
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
 
Eshell V5.9.2  (abort with ^G)
(yeq@sgwapp2)1>
(yeq@sgwapp2)1>
(yeq@sgwapp2)1> halt().
-bash-3.2$ erl
 
方法四:ctlr+c【发现还是这个方法快啊】
三次击键: 先输组合键 ctrl+c ,  然后敲 a, 然后敲  回车
-bash-3.2$ erl
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
 
Eshell V5.9.2  (abort with ^G)
1>  ^c
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution
a
-bash-3.2$
 

Eshell 的快捷键

之前录入shell的命令可以用Ctrl+P和Ctrl+N 来找回,也能用类似Emacs的编辑命令来编辑它们。
还没仔细研究。
 

help()的信息

-bash - 3. 2$ erl
Erlang R15B02 (erts - 5. 9. 2) [source] [ 64 -bit] [smp : 4 : 4] [async -threads : 0] [hipe] [kernel -poll :false]
Eshell V5. 9. 2 (abort with ^G)
1 > help().
** shell internal commands **
b() - - display all variable bindings
e(N) - - repeat the expression in query <N >
f() -- forget all variable bindings
f(X) - - forget the binding of variable X
h() - - history
history(N) - - set how many previous commands to keep
results(N) - - set how many previous command results to keep
catch_exception(B) - - how exceptions are handled
v(N) - - use the value of query <N >
rd(R,D) - - define a record
rf() - - remove all record information
rf(R) - - remove record information about R
rl() - - display all record information
rl(R) - - display record information about R
rp(Term) - - display Term using the shell 's record information
rr(File) -- read record information from File (wildcards allowed)
rr(F,R) -- read selected record information from file(s)
rr(F,R,O) -- read selected record information with options
** commands in module c **
bt(Pid) -- stack backtrace for a process
c(File) -- compile and load code in <File>
cd(Dir) -- change working directory
flush() -- flush any messages sent to the shell
help() -- help info
i() -- information about the system
ni() -- information about the networked system
i(X,Y,Z) -- information about pid <X,Y,Z>
l(Module) -- load or reload module
lc([File]) -- compile a list of Erlang modules
ls() -- list files in the current directory
ls(Dir) -- list files in directory <Dir>
m() -- which modules are loaded
m(Mod) -- information about module <Mod>
memory() -- memory allocation information
memory(T) -- memory allocation information of type <T>
nc(File) -- compile and load code in <File> on all nodes
nl(Module) -- load module on all nodes
pid(X,Y,Z) -- convert X,Y,Z to a Pid
pwd() -- print working directory
q() -- quit - shorthand for init:stop()
regs() -- information about registered processes
nregs() -- information about all registered processes
xm(M) -- cross reference check a module
y(File) -- generate a Yecc parser
** commands in module i (interpreter interface) **
ih() -- print help for the i module
true
2>

分布式相关命令

-name NodeName

这个选项使得启动的Erlang的运行时系统处于分布式模式下,节点名称为NodeName@FullyQualifiedName。
引用
-sname NodeName

这个选项使得启动的Erlang的运行时系统也处于分布式模式下,节点名称为NodeName@ShortName。
引用
-setcookie Cookie

该选项设置当前节点的Magic Cookie为Cookie,而不使用默认的~/.erlang.cookie中的内容作为Cookie。
引用
-connect_all false

这个选项设置该启动节点和其他Erlang节点的连接模式为非完全连接,即该节点仅仅保存和他直接通信的节点状态,非直接连接的节点状态不理会。
 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值