hmc 小秘密 -- 也许你知道

更新时间:2023-03-08 05:13:51 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

1 hmc用的是什么shell?hscroot 进入后是一个restricted的shell(什么是restrict的shell我在后面附上bash manual的说明)这个restricted shell是/bin/hmcbash 2 hmc的命令都在/hmcrbin/:/usr/hmcrbin下,hmcrbin下是通用的linux命令,、usrhmcrbin下是hmc的命令,所以只要ls一下这个目录就知道hmc都要那些命令了。

3 restricted shell禁止用/(也就是绝对路径调命令)但是不限制你用cat和ls等其他的命令来查看绝对路径下的文件。所以上面两条都忘了,知道这个第三条就行了。为什么?你自己想想吧。。。

The Restricted Shell If Bash is started with the name rbash, or the`--restricted'option is supplied at invocation, the shell becomes restricted.A restricted shell is used toset up an environment more controlled than the standard shell.A restricted shell behaves identically to bashwith the exception that the following are disallowed:

? ? ? ? ? ? ? ? ? ? ? ?

Changing directories with the cd builtin.

Setting or unsetting the values of the SHELL, PATH,ENV, or BASH_ENV variables. Specifying command names containing slashes.

Specifying a filename containing a slash as an argument to the .builtin command. Specifying a filename containing a slash as an argument to the `-p'option to the hash builtin command.

Importing function definitions from the shell environment at startup.

Parsing the value of SHELLOPTS from the shell environment at startup.

Redirecting output using the `>', `>|', `<>', `>&',`&>', and `>>' redirection operators.

Using the exec builtin to replace the shell with another command.

Adding or deleting builtin commands with the`-f' and `-d' options to the enable builtin.

Specifying the `-p' option to the command builtin.

Turning off restricted mode with `set +r' or `set +o restricted'.

HMC,我一直都是这样用的。

要查什么命令,就“where 关键字”。

要查什么命令,就“where 关键字”

怕你一时大意 搞混淆了吧

比如你要删除当前目录下的usr目录 本来是 rm -rf usr 一不小心写成 rm -rf /usr

本文来源:https://www.bwwdw.com/article/p3b.html

Top