Kmdr – 在终端中显示 CLI 命令说明

前段时间,我们写过 解释壳牌,一个基于 Web 的工具,用于了解 Linux 命令的每个部分的作用。 它将复杂而冗长的Linux命令分成多个部分,并对每个部分进行解释。 使用此工具,Linux 新手可以了解各种命令行参数和选项,而无需参考手册页。 但是,它只会帮助您学习 Linux 命令。 但是,如果您想学习其他 CLI 命令,例如 Python,该怎么办? 您不会在 ExplainShell 中找到 Python 命令的解释。 不用担心! 今天,我偶然发现了一个类似的工具,名为 指挥官 为数百个程序提供 CLI 命令解释。 它可以帮助您轻松学习 CLI 命令,而无需离开终端,也无需阅读冗长的手册页。 不仅仅是 Linux 命令,Kmdr 还提供了很多 CLI 命令的解释,包括 可靠的, 康达, 码头工人, 混帐, , kubectl, 蒙哥, mysql, 海平面以上, 红宝石, 流浪汉 以及数百个其他程序,例如内置的程序 bash.

Kmdr 可以理解复杂、冗长和子命令。 它还将理解包括管道、重定向、列表结构和其他命令在内的命令 bash-builtins 和运算符。 Kmdr 为您提供各种程序、工具和实用程序的解释,如下所示。

  • Bash Shell 内置程序(例如 echo、、cd)。
  • 容器(例如 Docker、kubectl)。
  • 版本控制(例如 Git)。
  • 数据库服务器和客户端(例如 mysql、mongod)。
  • 部署 / Cloud (例如现在的云)。
  • 文件和存档工具(例如 zip、tar)。
  • 媒体(例如 ffmpeg、youtube-dl)。
  • 网络/通信(例如 netstat、nmap、 curl)。
  • 包管理器(例如 dpkg、pip)。
  • 编程语言/运行时环境/编译器(例如 go、python、node、gcc)。
  • 系统管理员/监控(例如 crontab,顶部)。
  • 文本处理(例如 awk、sed)。
  • 文本编辑器(例如 nano、vim)。
  • 杂项(例如 openssl, bash, bash64)。

您可以查看支持程序的完整列表 这里. 开发人员每天都在添加更多程序。 密切关注列表并不时检查。

Kmdr 是免费的开源实用程序 节点.

安装 Kmdr CLI

Kmd 需要 Nodejs 版本 8.x 或以上。 如果您尚未在 Linux 系统上安装 Nodejs,请参阅以下链接。

  • 如何在 Linux 上安装 NodeJS

安装 Nodejs 后,您可以使用 Npm 包管理器安装 Kmdr CLI,如下所示。

$ npm install [email protected] --global

Kmdr 也可以直接从您的网络浏览器中使用。 无需安装或注册! 只需打开您的网络浏览器并导航到以下链接并提供您的命令。

  • https://demo.kmdr.sh/

使用 Kmdr 在终端中显示 CLI 命令说明

获取 CLI 命令的解释很容易! 以下面的命令为例。

$ history | awk '{print $2}' | sort | uniq -c | sort -nr | head -5

对于新手和中级 Linux 用户来说,这有点难以理解。 对于那些想知道的人,上面的命令将显示 最常用的命令 在 Linux 中。

如果您想了解上述命令中各个部分的解释,请使用以下命令启动 Kmdr CLI:

$ kmdr explain

Kmdr 将提示您输入命令。 只需键入它并按 ENTER 键。

样本输出:

? Enter your command: history | awk '{print $2}' | sort | uniq -c | sort -nr | head -5  history With no options, display the command history list with line numbers. | A pipe serves the sdout of the previous command as input (stdin) to the next one awk pattern scanning and processing language {print $2} An argument | A pipe serves the sdout of the previous command as input (stdin) to the next one sort Sort lines of text files | A pipe serves the sdout of the previous command as input (stdin) to the next one uniq Report or omit repeated lines -c, --count Prefix lines by the number of occurrences | A pipe serves the sdout of the previous command as input (stdin) to the next one sort Sort lines of text files -n, --numeric-sort Compare according to string numerical value -r, --reverse Reverse the result of comparisons | A pipe serves the sdout of the previous command as input (stdin) to the next one head Output the first part of files -5 An argument  ? Did we help you better understand this command? (Use arrow keys) ❯ Skip & Exit  ────────────── Yes  No

使用 Kmdr 从终端获取 CLI 命令说明

正如您在上面的输出中看到的那样,Kmdr 分解了上面命令中的每个部分并给出了每个部分的解释。

在解释的最后,Kmdr 会要求你分享你的反馈。 您可以选择 是的 或者 使用箭头发送反馈。 如果您选择是,只需输入反馈并按 ENTER。 如果您不想分享反馈,只需选择“Skip & Exit”退出Kmdr。就这么简单!

Kmdr 也能理解多个命令。