一款有趣而实用学习神器kmdr,让你解锁Linux学习新姿势

大家都知道,linux 系统有非常多的命令,而且每个命令又有非常多的用法,想要全部记住所有命令的所有用法,恐怕是一件不可能完成的任务。
一般情况下,我们学习一个命令时,要么直接百度去搜索它的用法,要么就直接用 man 命令去查看守冗长的帮助手册。这两个都可以实现我们的目标,但有没有更简便的方式呢?
答案是必须有的!今天给大家推荐一款有趣而实用学习神器 —kmdr,让你解锁 linux 学习新姿势。
kmdr工具最大的亮点就是,如果有一个长串命令你看不懂它的用法及意义,它将直接分模块给你详细解释!这个功能真的是非常实用,因为我们在网上或书上难免会看到各种各样的命令,如果你看不懂,那将永远留下疑惑。而这个工具就像老师一样,按模块一个个告诉你命令各个部分的用法及意义,让你一目了然!
kmdr收纳了非常多的 cli 命令解释,例如常见的ansible, conda, docker, git, go, kubectl, mongo, mysql, npm, ruby gems, vagrant等等,不仅如此,那些bash 内置命令它都能为你解释,非常给力!
不管你是哪个领域的程序员,kmdr都能最大限度地为你提供 cli 命令学习帮助。
bash shell 命令(如 echo,export,cd)
容器(如 docker,kubectl)
版本控制(如 git)
数据库服务器和客户端(如 mysql,mongod)
部署/云(如 now cloud)
文件和存档工具(如 zip,tar)
媒体(如 ffmpeg,youtube-dl)
网络/通讯(如 netstat,nmap,curl)
包管理器(如 dpkg,pip)
编程语言/运行时环境/编译器(如 go,python,node,gcc)
系统管理 /监控(如 crontab,top)
文字处理(如 awk,sed)
文本编辑器(如 nano,vim)
其他(如 openssl,bash,bash64)
这个链接里可以查看完整的支持列表:https://github.com/ediardo/kmdr-cli#supported-programs)
安装 kmdr cli
kmdr是用nodejs编写的免费开源工具,需要nodejs 版本 8.x或更高版本才能运行,需要大家先准备好运行环境。
安装好 nodejs 之后,使用 npm 软件包管理器安装 kmdr:
$npminstallkmdr@latest--global
不想安装 nodejs 这么麻烦?没关系,这里有一个网站可以让你在 web 浏览器直接使用kmdr↓↓
http://demo.kmdr.sh/
使用 kmdr 在终端中显示 cli 命令说明
下面我们通过一条复杂点的命令作为例子,来看看kmdr究竟有多强!
$history|awk'{print$2}'|sort|uniq-c|sort-nr|head-5
首先,运行下面的命令,让kmdr进入解释状态:
$kmdrexplain
接着,输入我们上面的示例命令,然后按enter键:
?enteryourcommand:history|awk'{print$2}'|sort|uniq-c|sort-nr|head-5 history withnooptions,displaythecommandhistorylistwithlinenumbers. | apipeservesthesdoutofthepreviouscommandasinput(stdin)tothenextone awk patternscanningandprocessinglanguage {print$2} anargument | apipeservesthesdoutofthepreviouscommandasinput(stdin)tothenextone sort sortlinesoftextfiles | apipeservesthesdoutofthepreviouscommandasinput(stdin)tothenextone uniq reportoromitrepeatedlines -c,--count prefixlinesbythenumberofoccurrences | apipeservesthesdoutofthepreviouscommandasinput(stdin)tothenextone sort sortlinesoftextfiles -n,--numeric-sort compareaccordingtostringnumericalvalue -r,--reverse reversetheresultofcomparisons | apipeservesthesdoutofthepreviouscommandasinput(stdin)tothenextone head outputthefirstpartoffiles -5 anargument didwehelpyoubetterunderstandthiscommand?(usearrowkeys) ❯skip&exit ────────────── yes no
可以看到kmdr这个命令的强大之处,它将那条复杂命令中每个部分的解释都给你列出来了,让你一目了然,一看就懂!
如果一个长串复杂命令里面包含了多个子命令,kmdr也可以一个个为你解释。
还可以解释具有分组选项的命令。
$kmdrexplain ?enteryourcommand:rsync-avz--exclude'liangxu'dir1/dir2/ rsync afast,versatile,remote(andlocal)file-copyingtool -a,--archive thisisequivalentto-rlptgod. -v,--verbose thisoptionincreasestheamountofinformationyouaregivenduringthetransfer. -z,--compress withthisoption,rsynccompressesthefiledataasitissenttothedestinationmachine,whichreducestheamountofdatabeingtransmitted--somethingthatisusefuloveraslowconnection. --exclude thisoptionisasimplifiedformofthe--filteroptionthatdefaultstoanexcluderuleanddoesnotallowthefullrule-parsingsyntaxofnormalfilterrules. liangxu anargument dir1/ anargument dir2/ anargument didwehelpyoubetterunderstandthiscommand?(usearrowkeys) ❯skip&exit ────────────── yes no
总结
个人认为,查看 cli 命令的帮助文档,一来其内容多而长,二来仔细去找会浪费时间和精力。而kmdr只要你输入你不懂的命令,直接就给你整明白,难道它不香吗?大家快点去试试吧。

苹果MR产业链分析
日本拟在2030年代中期禁售燃油汽车
索尼进军消费无人机市场,发布Airpeak无人机产品
Silicon Labs推出业界首款单晶片MEMS振荡器
产业协同效应推动下 长三角聚焦智能制造、机器人、人工智能等领域
一款有趣而实用学习神器kmdr,让你解锁Linux学习新姿势
工业物联网的作用
小米MIX2、vivoX20plus对比评测,配置、性能、拍照、价格对比分析你选谁?
ROHM开发厚膜分流电阻器 安森美发布应用于服务器和电信的MOSFET
十种变频器维修方法分享
物联网LoRa制式误区解读
DVD刻录机购买指南
数字助听器原理及解决方案
极路由宣布推出全球首台区块链路由器--极X
华为MateBook 13和14你会不会买
高亮度LED照明系统低温设计挑战
PCBA电路板使用三防漆的作用有哪些?
永诺即将发布新款AF 50mm f/1.4 自动镜头
零基础入行深度学习
Proteus8.9 仿真STM32407ZGT6系列001_走马灯