有意思又好玩的Linux命令学习神器Kmdr
发布时间:2023-07-17 14:53:20 所属栏目:Linux 来源:
导读:接触过 Linux 的小伙伴是不是发现,要想玩转Linux ,有那么多的命令要学习,简直就是学习路上的拦路虎啊。
不懂命令怎么办?学命令,上百度?还是用 man 命令?虽然这两个都没问题,但是有没有更便利的命令解释器
不懂命令怎么办?学命令,上百度?还是用 man 命令?虽然这两个都没问题,但是有没有更便利的命令解释器
接触过 Linux 的小伙伴是不是发现,要想玩转Linux ,有那么多的命令要学习,简直就是学习路上的拦路虎啊。 不懂命令怎么办?学命令,上百度?还是用 man 命令?虽然这两个都没问题,但是有没有更便利的命令解释器工具呢? 今天给大家推荐一款有趣又实用学习神器——kmdr,从此学习 Linux 命令 so easy。 kmdr 工具的厉害之处在哪儿呢? 首先,对 Linux 新手友好。每个命令给你分割的清清楚楚。每个复杂的命令,切割成不同部分,每个部分都给出详细解释,对 Linux 小白来讲,简直不要太友好。 其次,对于 Linux 老司机来说,某个不常用的命令,一下子卡壳了,600 多个命令随便查,终于不用翻操作手册。是不是觉得奥力给? 总之呢 kmdr 集成了大部分 CLI 命令解释,例如常见的 ansible,conda,docker,git,go,kubectl,mongo,mysql,npm,ruby gems,vagrant 等等,另外,bash 内置命令都有详细解释。 kmdr 给力的地方还在于可以支持大部分场景开发场景,支持清单如下: 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 或更高版本才能运行,所以环境要求是; Node.js v8.x及更高版本 包管理器,例如 npm 或 yarn 安装好 Nodejs 之后,使用 Npm 软件包管理器安装 kmdr: $ npm install kmdr@latest --global 不想安装 Nodejs ,没关系,你可以登录以下网站在 web 浏览器直接使用 kmdr http://demo.kmdr.sh/ macOS安装命令: brew install kommandr / tap / kmdr 检查安装情况 运行命令 kmdr 以检查它是否已正确安装在系统上。 $ kmdr Usage: kmdr [options] [command] The ultimate CLI learning tool for explaining commands from your terminal kmdr provides command explanations for hundreds of programs including git,docker, kubectl, npm, go and more straight forward programs such as bash builtins. Options: -v, --version output the version number -h, --help output usage information Commands: explain|e [options] Explain a shell command upgrade|u Check for new releases feedback|f Send feedback 成功安装后初次登录需要在官网注册账号: $ kmdr login 使用 Kmdr 在终端中显示 CLI 命令说明 我们以下面这条比较长的命令,来学习 kmdr的使用: $ history | awk '{print $2}' | sort | uniq -c | sort -nr | head -5 首先,运行下面的命令,让 kmdr 进入解释状态: $ kmdr explain 接着,输入我们上面的示例命令,然后按 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 这个工具,它可以将复杂命令中每个组成部分依次列出,连参数的含义都解释的很清楚,让你一下子就可以明白其中的意思! 此外,一个长串复杂命令里包含了多个子命令,kmdr 也可以一个个为你解释。 还可以解释具有分组选项的命令。 $ kmdr explain ? Enter your command: rsync -avz --exclude 'liangxu' 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. liangxu An argument dir1/ An argument dir2/ An argument ��� Did we help you better understand this command? (Use arrow keys) ❯ Skip & Exit ────────────── Yes No (编辑:聊城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐