3.3. 其它命令
3.3.1. 退出 CLI shell(EOF)
EOF 命令退出 CLI shell(或按 Ctrl+D 键)。
EOF
例 3.10. EOF 使用示例
[RHEVM shell (connected)]# EOF
3.3.2. 列出系统的能力(capabilities)
capabilties --features 命令列出所有版本的能力,以及当前版本的新功能。
capabilities --features
例 3.11. capabilities 示例
[RHEVM shell (connected)]# capabilities --features name : Search - Case Sensitivity description : Ability to specify whether a search query should ignore case, by providing a URL parameter url-parameters_set-parameter-name : case_sensitive url-parameters_set-parameter-context: matrix url-parameters_set-parameter-type : boolean :
3.3.3. 清屏(clear)
clear 命令清空 CLI 屏幕。
clear
例 3.12. clear 使用示例
[RHEVM shell (connected)]# clear
3.3.4. 连接到 VM(console)
console 命令打开到一个虚拟机的图形控制台。这个命令会根据虚拟机的 display-type 参数设置使用 VNC 或 SPICE。
console [vm-id|vm-name]
例 3.13. console 命令使用示例
[RHEVM shell (connected)]# console RHEL6-Server
3.3.5. 显示输入的信息(echo)
echo 命令在平面上显示输入的信息。使用 $out 来显示最后一个 shell 命令的输出。
echo [input]
例 3.14. 使用 echo 示例
[RHEVM shell (connected)]# echo "Example text!"
[RHEVM shell (connected)]# echo $out
3.3.6. 退出 CLI(exit)
exit 命令退出 CLI。
exit
例 3.15. exit 命令示例
[RHEVM shell (connected)]# exit
3.3.7. 运行一个脚本(file)
file 命令运行一个 CLI 脚本文件。脚本文件包括了一组可执行命令的文本文件。
file [file-location]
例 3.16. file 命令示例
[RHEVM shell (connected)]# file /example/example-script
3.3.8. 显示帮助信息(help)
help 命令显示 CLI 命令的帮助信息。
help [command] [resource] [options]
例 3.17. help 命令的帮助示例
[RHEVM shell (connected)]# help
add 命令的帮助信息:
[RHEVM shell (connected)]# help add
vm 的 add 命令的帮助信息。
[RHEVM shell (connected)]# help add vm
3.3.9. 显示用户命令的历史记录(history)
history 命令显示在 CLI shell 中所运行命令的历史记录。
history
例 3.18. history 命令使用示例
[RHEVM shell (connected)]# history
例 3.19. history --first 示例
--first n 参数显示历史记录中开始的 n 条信息:
[RHEVM shell (connected)]# history --first 5
例 3.20. history --last 示例
--last n 参数显示历史记录中最后的 n 条信息:
[RHEVM shell (connected)]# history --last 5
3.3.10. 显示 CLI 信息(info)
info 命令显示所在环境的连接详情和版本信息。
info
例 3.21. info 命令使用示例
[RHEVM shell (connected)]# info backend version: 3.1 sdk version : 3.1.0.4 cli version : 3.1.0.6 python version : 2.7.3.final.0 entry point : https://www.example.com:8443/api
3.3.11. 测试连接(ping)
ping 命令测试到 Red Hat Virtualization Manager 的连接。如果这个命令收到了从远程系统发回的响应,说明连接所使用的 URL、用户名和密码是正确的。
ping
例 3.22. 使用 ping 命令示例
[RHEVM shell (connected)]# ping success: RHEVM manager could be reached OK.
3.3.12. 运行一个 Shell 命令(shell)
shell 命令从 Linux shell 中运行一个命令。这个命令可以和 Red Hat Virtualization Manager shell 一起被用来执行文件管理任务。
shell [vm-id|vm-name]
例 3.23. 使用 shell 命令示例
[RHEVM shell (connected)]# shell ls
[RHEVM shell (connected)]# shell touch example.txt
[RHEVM shell (connected)]# shell cp example.txt /example-dir/.
注意
! 和使用 shell 命令的功能是相同的。例如:
[RHEVM shell (connected)]# !touch example.txt
3.3.13. 显示最后运行的命令的状态(status)
status 命令显示最新运行命令的状态。
status
例 3.24. status 命令使用示例
[RHEVM shell (connected)]# status last command status: 0 (OK)
3.3.14. 显示系统的概况(summary)
summary 命令显示系统状态的概况。
summary
例 3.25. summary 命令使用示例
[RHEVM shell (connected)]# summary hosts-active : 1 hosts-total : 2 storage_domains-active: 2 storage_domains-total : 3 users-active : 1 users-total : 1 vms-active : 1 vms-total : 1

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.