【开源 Mac 工具推荐之 5】tldr:简洁明了的命令行手册显示工具

news2024/9/20 3:30:51

简介

在大家日常在 macOS/Linux 上使用 Shell 的时候,常常会遇到一些不太熟悉的命令行指令,为此我们一般会查看一下该命令的使用手册(指南)。往往,大家都会使用 man <command> 这样一个非常传统的指令。但 man 也有一些缺点,比如显示的信息过于冗余等。

其实,GitHub 上有一个几乎完美的命令行手册显示工具,叫做 tldr。它能够提供比 man 简介明了多的说明。

tldr 项目地址:https://github.com/tldr-pages/tldr
(注:本文同时适用于 macOS 和 Linux)

想看看效果的话,可以看看这个例子。

举例

unar 举个例子:

(顺便说一句,只能拿小的命令来举例,要不然 man 就会输出几千行几万行)

使用 man unar

unar(1)                          User Commands                         unar(1)

NAME
       unar - extract archive file contents

SYNOPSIS
       unar [OPTION]... ARCHIVE [FILE]...

DESCRIPTION
       Extract FILEs or the contents of ARCHIVE.

OPTIONS
       -o, -output-directory DIRECTORY
              The directory to write the contents of the archive to.  Defaults
              to the current directory.

       -f, -force-overwrite
              Always overwrite files when a file to be unpacked already exists
              on disk.  By default, the program asks the user if possible,
              otherwise skips the file.

       -r, -force-rename
              Always rename files when a file to be unpacked already exists on
              disk.

       -s, -force-skip
              Always skip files when a file to be unpacked already exists on
              disk.

       -d, -force-directory
              Always create a containing directory for the contents of the
              unpacked archive.  By default, a directory is created if there
              is more than one top-level file or folder.

       -D, -no-directory
              Never create a containing directory for the contents of the
              unpacked archive.

       -p, -password PASSWORD
              The password to use for decrypting protected archives.

       -e, -encoding ENCODING
              The encoding to use for filenames in the archive, when it is not
              known.  If not specified, the program attempts to auto-detect
              the encoding used.  Use "help" or "list" as the argument to give
              a listing of all supported encodings.

       -E, -password-encoding ENCODING
              The encoding to use for the password for the archive, when it is
              not known.  If not specified, then either the encoding given by
              the -encoding option or the auto-detected encoding is used.

       -i, -indexes
              Instead of specifying the files to list as filenames or wildcard
              patterns, specify them as indexes, as output by lsar.

       -nr, -no-recursion
              Do not attempt to extract archives contained in other archives.
              For instance, when unpacking a .tar.gz file, only unpack the
              .tar file and not its contents.
unar(1)                          User Commands                         unar(1)

NAME
unar(1)                          User Commands                         unar(1)

NAME
       unar - extract archive file contents

SYNOPSIS
       unar [OPTION]... ARCHIVE [FILE]...

DESCRIPTION
       Extract FILEs or the contents of ARCHIVE.

OPTIONS
       -o, -output-directory DIRECTORY
              The directory to write the contents of the archive to.  Defaults
              to the current directory.

       -f, -force-overwrite
              Always overwrite files when a file to be unpacked already exists
              on disk.  By default, the program asks the user if possible,
              otherwise skips the file.

       -r, -force-rename
              Always rename files when a file to be unpacked already exists on
              disk.

       -s, -force-skip
              Always skip files when a file to be unpacked already exists on
              disk.

       -d, -force-directory
              Always create a containing directory for the contents of the
              unpacked archive.  By default, a directory is created if there
              is more than one top-level file or folder.

       -D, -no-directory
              Never create a containing directory for the contents of the
              unpacked archive.

       -p, -password PASSWORD
              The password to use for decrypting protected archives.

       -e, -encoding ENCODING
              The encoding to use for filenames in the archive, when it is not
              known.  If not specified, the program attempts to auto-detect
              the encoding used.  Use "help" or "list" as the argument to give
              a listing of all supported encodings.

       -E, -password-encoding ENCODING
              The encoding to use for the password for the archive, when it is
              not known.  If not specified, then either the encoding given by
              the -encoding option or the auto-detected encoding is used.

       -i, -indexes
              Instead of specifying the files to list as filenames or wildcard
              patterns, specify them as indexes, as output by lsar.

       -nr, -no-recursion
              Do not attempt to extract archives contained in other archives.
              For instance, when unpacking a .tar.gz file, only unpack the
              .tar file and not its contents.

       -t, -copy-time
              Copy the file modification time from the archive file to the
              containing directory, if one is created.

       -k, -forks visible|hidden|skip
              How to handle Mac OS resource forks.  visible creates
              AppleDouble files with the extension ".rsrc", hidden creates
              AppleDouble files with the prefix "._", and skip discards all
              resource forks.  Defaults to visible.

       -q, -quiet
              Run in quiet mode.

       -v, -version
              Print version and exit.

       -h, -help
              Display help information.

SEE ALSO
       lsar(1)

The Unarchiver                    2011-09-26                           unar(1)
(END)

可以看出,真的是——长长长长长长长……
而且,大部分命令其实我们都不怎么需要。

再看看 tldr unar

  unar

  从归档文件中提取内容。
  更多信息:https://manned.org/unar.

  提取一个归档文件到当前目录:

    unar 归档文件

  提取一个归档文件到指定目录:

    unar -o 路径/到/目录 归档文件

  如果要提取的文件已经存在,则总是覆盖:

    unar -f 归档文件

  如果要提取的文件已经存在,则总是重命名:

    unar -r 归档文件

  如果要提取的文件已经存在,则总是跳过:

    unar -s 归档文件

还适配中文,并且信息非常简单集中,十分人性化。

了解差距了吧?

使用方法

tldr 有三种最常用的方法来安装:

  1. npm 安装
npm install -g tldr
  1. Python pip 安装
pip3 install tldr
  1. Homebrew 安装
brew install tlrc

请大家注意,这些命令需要的环境可能没有预置在某些电脑上,这就需要你先去安装 Node.js、Python 3 或 Homebrew。本人有一些文章可供参考:

Node.js 的安装与使用(npm)
cnpm 的安装与使用
Python 更换 pip 源详细指南
Homebrew 安装与配置(macOS)
Homebrew安装与配置(Linux)

关于 Python 的安装,可以参考 Python 的官网(Python.org)。

其他更多操作,请参考项目地址上的说明。


本文完。

【开源 Mac 工具推荐】系列将会持续更新,关注我(YoungGeeker),一起探索少年极客的世界!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2086848.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

YOLOv8改进 | 融合改进 | C2f融合Faster-GELU模块提升检测速度【完整代码 + 主要代码解析】

秋招面试专栏推荐 &#xff1a;深度学习算法工程师面试问题总结【百面算法工程师】——点击即可跳转 &#x1f4a1;&#x1f4a1;&#x1f4a1;本专栏所有程序均经过测试&#xff0c;可成功执行&#x1f4a1;&#x1f4a1;&#x1f4a1; 专栏目录 &#xff1a;《YOLOv8改进有效…

Unity URPShader支持多光源处理

//声明变体并且引用文件 #pragma shader_feature _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" //在数据结构体中声明需要使用的数据 struct Attributes {float4 posit…

如何写一份简单的3C产品说明书?五步让你留住客源

在撰写3C&#xff08;计算机、通信、消费电子&#xff09;产品说明书时&#xff0c;清晰、简洁且全面的信息传递至关重要。本文将首先介绍产品说明书的基本结构&#xff0c;随后探讨视觉阅读的重要性&#xff0c;并通过实例展示如何撰写一份优秀的产品说明书。最后&#xff0c;…

SpringBoot2:学SpringBoot前的知识准备-用IDEA创建传统的webapp工程,并整合SpringMVC

1、IDEA创建工程 基于Maven模板创建的SpringMVC工程 工程创建好后&#xff0c;只有webapp目录 这里&#xff0c;我们需要手动创建java目录和resources配置文件目录 创建好后&#xff0c;配置下目录属性 最终结构 至此&#xff0c;工程就创建好了 2、配置Tomcat 参考&am…

LabVIEW中10μs方波生成问题

在LabVIEW中使用NI PCIe-6353卡生成并控制10μs级别的方波输出可能遇到频率调整的问题。下面将详细分析常见问题的原因&#xff0c;如采样率设置、时钟源配置、波形生成方式等&#xff0c;并提供具体的解决方案&#xff0c;帮助用户成功生成并调整高精度方波信号。 为了在LabVI…

孙悟空求药的深刻反思

孙悟空求药的深刻反思 - 孔乙己大叔引言&#xff1a;孙悟空的求药之旅 在古老的神话故事中&#xff0c;孙悟空为了拯救乌鸡国国王的生命&#xff0c;不惜跨越千山万水&#xff0c;前往太上老君的仙宫&#xff0c;祈求那传说中的九转还魂丹。面对孙悟空那看似贪婪的一千…

【案例65】WebSphere启动比tomcat启动慢的测试

以下为多次测试的一些结论&#xff0c;谨慎使用&#xff0c;请一定做好测试后在使用。 1.在原先慢的WAS环境下&#xff0c;添加-Dsun.reflect.inflationThreshold15,可以有效提升was下的响应速度&#xff0c;和Tomcat下速度相当&#xff0c;但该参数15的情况我们Tomcat以前还没…

FastGPT:利用大模型重新定义传统知识库

引言 传统知识库的痛点 传统知识库广泛应用于企业文档管理、客户支持等场景&#xff0c;但随着信息量和复杂度的增加&#xff0c;存在以下显著问题&#xff1a; 数据难整合&#xff1a; 结构化与非结构化数据分散&#xff0c;更新维护成本高。检索不精准&#xff1a; 依赖关…

day03-面向对象-内部类泛型常用API

一、内部类 内部类是类中的五大成分之一&#xff08;成员变量、方法、构造器、代码块、内部类&#xff09; 如果一个类定义在另一个类的内部&#xff0c;这个类就是内部类。 场景&#xff1a;当一个类的内部&#xff0c;包含了一个完整的事物&#xff0c;且这个事物没有必要单…

Go发布自定义包

1、初始化go.mod go mod init github.com/xumeng03/images2、编写包内容 这里只是一个简单的压缩jpg/jpeg图片例子&#xff0c;代码参考 https://github.com/disintegration/imaging 2.1、fs.go package imagesimport ("image""io""os""p…

利用通义灵码实现我的第一次开源贡献

作者&#xff1a;重庆邮电大学计算机学院李逸雄 结缘开源 最早了解开源是从学校的兴趣组织开始的。2023 年 10 月 21 日&#xff0c;openSUSE 亚洲峰会在我们学校召开&#xff0c;这次会议汇聚了许多来自 openSUSE 社区贡献者以及对开源感兴趣的爱好者们。我第一次知道有这么…

postman使用记录

输入密码&#xff0c;地址 然后输入格式为json 在 body里写入传参 然后点击发送即可

裸机:SD卡启动详解

内存和外存的区别 内存和外存在计算机系统中扮演着不同的角色&#xff0c;它们之间存在显著的差异。以下是内存和外存之间几个主要方面的区别&#xff1a; 存储特性与易失性 内存&#xff08;Memory&#xff09;&#xff1a;通常指的是随机存取存储器&#xff08;RAM&#x…

Java面试题·区别题·JavaSE部分

系列文章目录 总章 Java区别题 文章目录 系列文章目录前言private/默认/protected/public权限修饰符的区别&和&&区别和联系&#xff0c;I和II区别和联系if和switch的不同之处和equals的区别和联系数组做形参和可变参数做形参联系和区别接口和抽象类的异同之处面向…

Android设备如何异地访问本地部署的code-server随时随地远程开发

文章目录 前言1.Ubuntu本地安装code-server2. 安装cpolar内网穿透3. 创建隧道映射本地端口4. 安卓平板测试访问5.固定域名公网地址6.结语 前言 本文主要介绍如何在Linux Ubuntu系统安装code-server&#xff0c;并结合cpolar内网穿透工具配置公网地址&#xff0c;轻松实现使用安…

企业级开发——Git使用

一 Git介绍 1 什么是版本控制 版本控制是指对软件开发过程中各种程序代码、配置文件及说明文档等文件变更的管理&#xff0c;是软件配置管理的核心思想之一。 2 为什么使用版本控制 采用手动复制的方式管理版本&#xff0c;会造成版本管理混乱&#xff0c;而通过版本控制管…

测试使用开源异构迁移工具dbswitch

dbswitch: 异构数据库迁移同步(搬家)工具 (base) rootnode13:~# cat /etc/issue Ubuntu 20.04.5 LTS \n \l (base) rootnode13:~# curl -k -sSL https://gitee.com/dromara/dbswitch/attach_files/1878800/download > /tmp/dbswitch_install.sh && bash /tmp/dbsw…

地级市地理相邻矩阵(地级市名称版、行政区划代码版)

地级市地理相邻矩阵&#xff08;地级市名称版、行政区划代码版&#xff09; 范围&#xff1a;294个地级市 格式&#xff1a;地级市名称版、行政区划代码版 说明&#xff1a;数据为同省下城市之间的相邻矩阵&#xff0c;表示同一省份内各个城市相互之间邻近关系。如果同一省份…

VTK+Qt+Cmake+VS的环境搭建

VTKQtCmakeVS的环境搭建 一、准备工作二、VTK源码安装过程三、错误排查四、Cmake中引用VTK五、代码示例 本文的主要内容&#xff1a;简单介绍如何使用Cmake编译安装VTK源代码&#xff1b;如何配置VTK在Qt中的使用环境&#xff1b;如何以VS作为IDE在C下使用QtVTK。 哪些人适合阅…