前段时间,我们写过 解释壳牌,一个基于 Web 的工具,用于了解 Linux 命令的每个部分的作用。 它将复杂而冗长的Linux命令分成多个部分,并对每个部分进行解释。 使用此工具,Linux 新手可以了解各种命令行参数和选项,而无需参考手册页。 但是,它只会帮助您学习 Linux 命令。 但是如果你想学习其他 CLI 命令怎么办? example Python? 您不会在 ExplainShell 中找到 Python 命令的解释。 不用担心! 今天,我偶然发现了一个类似的工具,名为 公里数 为数百个程序提供 CLI 命令解释。 它可以帮助您轻松学习 CLI 命令,而无需离开终端,也无需阅读冗长的手册页。 不仅仅是 Linux 命令,Kmdr 还提供了很多 CLI 命令的解释,包括 可靠的, 康达, 码头工人, 混帐, 去, kubectl, 蒙哥, mysql, npm, 红宝石, 流浪汉 以及数百个其他程序,例如内置的程序 bash.
Kmdr 可以理解复杂、冗长和子命令。 它还将理解包括管道、重定向、列表结构和其他命令在内的命令 bash-builtins 和运算符。 Kmdr 为您提供各种程序、工具和实用程序的解释,如下所示。
- Bash Shell 内置程序(例如 echo、export、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, bashbash64)。
您可以查看支持程序的完整列表 这里. 开发人员每天都在添加更多程序。 密切关注列表并不时检查。
Kmdr 是免费的开源实用程序 节点.
安装 Kmdr CLI
Kmd 需要 Nodejs 版本 8.x 或以上。 如果您尚未在 Linux 系统上安装 Nodejs,请参阅以下链接。
- 如何在 Linux 上安装 NodeJS
安装 Nodejs 后,您可以使用 Npm 包管理器安装 Kmdr CLI,如下所示。
$ npm install [email protected] --global
Kmdr 也可以直接从您的网络浏览器中使用。 无需安装或注册! 只需打开您的网络浏览器并导航到以下链接并提供您的命令。
使用 Kmdr 在终端中显示 CLI 命令说明
获取 CLI 命令的解释很容易! 将以下命令作为 example.
$ 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 也能理解多个命令。
也可以通过分组选项获得命令的解释。
$ kmdr explain ? Enter your command: rsync -avz --exclude 'ostechnix' dir1/ dir2/ rsync A fast, versatile, remote (and local) file-copying tool -a, --archive This is equivalent to -rlptgoD. -v, --verbose This option increases the amount of information you are given during the transfer. -z, --compress With this option, rsync compresses the file data as it is sent to the destination machine,which reduces the amount of data being transmitted -- something that is useful over a slow connection. --exclude This option is a simplified form of the --filter option that defaults to an exclude rule anddoes not allow the full rule-parsing syntax of normal filter rules. ostechnix An argument dir1/ An argument dir2/ An argument ? Did we help you better understand this command? (Use arrow keys) ❯ Skip & Exit ────────────── Yes No
我已经给出了简单的例子。 您可以尝试各种复杂的命令,包括管道、重定向、子命令、运算符等。
建议阅读:
- 即时搜索、学习和练习 Linux 命令!
- 免费在线学习和练习 Linux 命令!
- 通过玩命令行游戏测试您的 BASH 技能
- 学习有效地使用手册页
在尝试了几个命令后,我注意到 Kmdr 没有输入其他命令的选项。 我不得不退出 Kmdr 然后重新打开它并再次输入另一个命令。 如果它允许我添加其他命令而不必每次都重新运行“kmdr explain”会更好。 除了这个小问题,Kmdr 在我的 Ubuntu 18.04 系统上运行良好。
更新:
此问题已在最新的 Kmdr 版本中得到修复。 kmdr v0.2 让您可以连续搜索命令,而无需每次重新输入“kmdr explain”。
Kmdr CLI 客户端非常新,仍处于早期阶段。 我希望开发人员在未来的日子里通过添加更多功能来改进它。 试一试,并在下面的评论部分分享您的想法。
资源:
感谢您的光临!
帮助我们帮助您:
- 订阅我们的电子邮件通讯: 立即注册
- 支持 OSTechNix: 通过贝宝捐款
- 下载免费的电子书和视频: TradePub 上的 OSTechNix
- 联系我们: 红迪网 | Facebook | Twitter | 领英 | RSS订阅
祝你有美好的一天!!