1 Star 0 Fork 0

OpenDocCN / ds-cmd-line-2e-zh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
12.md 29.96 KB
一键复制 编辑 原始数据 按行查看 历史
布客飞龙 提交于 2023-03-29 18:24 . 2023-03-29 18:24:08

附录:命令行工具列表

原文:https://datascienceatthecommandline.com/2e/list-of-command-line-tools.html

这是本书中讨论的所有命令行工具的概述。这包括二进制可执行文件、解释脚本和 ZShell 内置文件和关键字。对于每个命令行工具,如果可用且适当,将提供以下信息:

  • 要在命令行中键入的实际命令
  • 描述
  • 书中使用的版本
  • 该版本发布的年份
  • 主要作者
  • 查找更多信息的网站
  • 如何获得帮助
  • 一个用法示例

这里列出的所有命令行工具都包含在 Docker 映像中。有关如何设置的说明,请参见第二章。请注意,引用开源软件不是小事,一些信息可能会丢失或不正确。

alias

定义或显示别名。alias是一个 ZShell 内置。

$ type alias
alias is a shell builtin

$ man zshbuiltins | grep -A 10 alias

$ alias l
l='ls --color -lhF --group-directories-first'

$ alias python=python3

awk

模式扫描和文本处理语言。awk(版本 1.3.4)作者:迈克·D·布伦南和托马斯·E·迪基(2019)。更多信息:https://invisible-island.net/mawk

$ type awk
awk is /usr/bin/awk

$ man awk

$ seq 5 | awk '{sum+=$1} END {print sum}'
15

aws

管理 AWS 服务的统一工具。aws(版本 2.1.32)由亚马逊网络服务(2021)提供。更多信息:https://aws.amazon.com/cli

$ type aws
aws is /usr/local/bin/aws

$ aws --help

bash

GNU Bourne-再次壳。bash(5.0.17 版)布莱恩·福克斯和切特·雷米(2019)。更多信息:https://www.gnu.org/software/bash

$ type bash
bash is /usr/bin/bash

$ man bash

bat

一个带有语法高亮和 Git 集成的cat克隆。bat(版本 0.18.0)作者大卫·彼得(2021)。更多信息:https://github.com/sharkdp/bat

$ type bat
bat is an alias for bat --tabs 8 --paging never

$ man bat

bc

任意精度计算器语言。bc(版本 1.07.1)作者菲利普·A·纳尔逊(2017)。更多信息:https://www.gnu.org/software/bc

$ type bc
bc is /usr/bin/bc

$ man bc

$ bc -l <<< 'e(1)'
2.71828182845904523536

body

对除第一行以外的所有行应用命令。body(0.1 版)作者耶鲁安·扬森斯(2021)。更多信息:https://github.com/jeroenjanssens/dsutils

$ type body
body is /usr/bin/dsutils/body

$ seq 10 | header -a 'values' | body shuf
values
9
6
1
3
2
7
5
10
8
4

cat

连接文件并在标准输出上打印。托尔比约恩·格兰隆德和理查德·M·斯托曼(2018 年)著cat(版本 8.30)。更多信息:https://www.gnu.org/software/coreutils

$ type cat
cat is /usr/bin/cat

$ man cat

$ cat *.log > all.log

cd

更改 Shell 工作目录。cd是一个 ZShell 内置。

$ type cd
cd is a shell builtin

$ man zshbuiltins | grep -A 10 cd

$ cd ~

$ pwd
/home/dst

$ cd ..

$ pwd
/home

$ cd /data/ch01
cd: no such file or directory: /data/ch01

chmod

更改文件模式位。chmod(8.30 版)作者大卫·麦肯齐和吉姆·迈耶林(2018)。我使用第四章中的chmod来制作一个可执行的工具。更多信息:https://www.gnu.org/software/coreutils

$ type chmod
chmod is /usr/bin/chmod

$ man chmod

$ chmod u+x script.sh

cols

将命令应用于列的子集。cols(0.1 版)作者耶鲁安·扬森斯(2021)。更多信息:https://github.com/jeroenjanssens/dsutils

$ type cols
cols is /usr/bin/dsutils/cols

column

column(版本 2.36.1)作者卡雷尔·扎克(2021)。更多信息:https://www.kernel.org/pub/linux/utils/util-linux

$ type column
column is /usr/bin/column

cowsay

可配置的说话牛。托尼·门罗(1999 年)的作品。更多信息:https://github.com/tnalpgge/rank-amateur-cowsay

$ type cowsay
cowsay is /usr/bin/cowsay

$ man cowsay

$ echo 'The command line is awesome!' | cowsay
 ______________________________
< The command line is awesome! >
 ------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

cp

复制文件和目录。托尔比约恩·格兰伦德、大卫·麦肯齐和吉姆·迈耶林(2018 年)。更多信息:https://www.gnu.org/software/coreutils

$ type cp
cp is /usr/bin/cp

$ man cp

$ cp -r ~/Downloads/*.xlsx /data

csv2vw

将 CSV 转换为 Vowpal Wabbit 格式。csv2vw(0.1 版)作者耶鲁安·扬森斯(2021)。更多信息:https://github.com/jeroenjanssens/dsutils

$ type csv2vw
csv2vw is /usr/bin/dsutils/csv2vw

csvcut

过滤和截断 CSV 文件。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type csvcut
csvcut is /usr/bin/csvcut

$ csvcut --help

$ csvcut -c bill,tip /data/ch05/tips.csv | trim
bill,tip
16.99,1.01
10.34,1.66
21.01,3.5
23.68,3.31
24.59,3.61
25.29,4.71
8.77,2.0
26.88,3.12
15.04,1.96
… with 235 more lines

csvgrep

搜索 CSV 文件。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type csvgrep
csvgrep is /usr/bin/csvgrep

$ csvgrep --help

csvjoin

执行类似 SQL 的联接,以合并指定列上的 CSV 文件。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type csvjoin
csvjoin is /usr/bin/csvjoin

$ csvjoin --help

csvlook

在控制台中将 CSV 文件呈现为与 Markdown 兼容的固定宽度表格。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type csvlook
csvlook is a shell function

$ csvlook --help

$ csvlook /data/ch05/tips.csv
│  bill │   tip │ sex    │ smoker │ day  │ time   │ size │
├───────┼───────┼────────┼────────┼──────┼────────┼──────┤
│ 16.99 │  1.01 │ Female │  False │ Sun  │ Dinner │    2 │
│ 10.34 │  1.66 │ Male   │  False │ Sun  │ Dinner │    3 │
│ 21.01 │  3.50 │ Male   │  False │ Sun  │ Dinner │    3 │
│ 23.68 │  3.31 │ Male   │  False │ Sun  │ Dinner │    2 │
│ 24.59 │  3.61 │ Female │  False │ Sun  │ Dinner │    4 │
│ 25.29 │  4.71 │ Male   │  False │ Sun  │ Dinner │    4 │
│  8.77 │  2.00 │ Male   │  False │ Sun  │ Dinner │    2 │
│ 26.88 │  3.12 │ Male   │  False │ Sun  │ Dinner │    4 │
… with 236 more lines

csvquote

使常见的 unix 工具能够正确处理 CSV 数据。csvquote(0.1 版)作者丹·布朗(2018)。更多信息:https://github.com/dbro/csvquote

$ type csvquote
csvquote is /usr/local/bin/csvquote

csvsort

对 CSV 文件排序。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type csvsort
csvsort is /usr/bin/csvsort

$ csvsort --help

csvsql

对 CSV 文件执行 SQL 语句。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type csvsql
csvsql is /usr/bin/csvsql

$ csvsql --help

csvstack

堆叠多个 CSV 文件中的行。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type csvstack
csvstack is /usr/bin/csvstack

$ csvstack --help

csvstat

打印 CSV 文件中每一列的描述性统计数据。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type csvstat
csvstat is /usr/bin/csvstat

$ csvstat --help

curl

传输一个 URL。curl(版本 7.68.0)作者丹尼尔·斯坦伯格(2016)。更多信息: https://curl.haxx.se

$ type curl
curl is /usr/bin/curl

$ man curl

cut

从文件的每一行中删除节。cut(8.30 版)作者大卫·m·伊纳特、大卫·麦肯齐、吉姆·迈耶林(2019)。更多信息:https://www.gnu.org/software/coreutils

$ type cut
cut is /usr/bin/cut

$ man cut

display

在任何 X 服务器上显示图像或图像序列。display(版本 6.9.10-23)作者 ImageMagick Studio LLC (2019)。更多信息:https://imagemagick.org

$ type display
display is a shell function

dseq

生成日期序列。dseq(0.1 版)作者耶鲁安·扬森斯(2021)。更多信息:https://github.com/jeroenjanssens/dsutils

$ type dseq
dseq is /usr/bin/dsutils/dseq

$ dseq 3
2022-03-04
2022-03-05
2022-03-06

echo

显示一行文本。echo(8.30 版)布莱恩·福克斯和切特·雷米(2019)。对于使用文字文本作为下一个工具的标准输入非常有用。更多信息:https://www.gnu.org/software/coreutils

$ type echo
echo is a shell builtin

$ man echo

$ echo Hippopotomonstrosesquippedaliophobia | cowsay
 ______________________________________
< Hippopotomonstrosesquippedaliophobia >
 --------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

$ echo -n Hippopotomonstrosesquippedaliophobia | wc -c
36

env

在修改后的环境中运行程序。理查德·姆林纳里克、大卫·麦肯齐和阿萨夫·戈登(2018 年)。更多信息:https://www.gnu.org/software/coreutils

$ type env
env is /usr/bin/env

$ man env

export

设置 Shell 变量的导出属性。有助于使 Shell 变量对其他命令行工具可用..export是一个 ZShell 内置。

$ type export
export is a reserved word

$ man zshbuiltins | grep -A 10 export

$ export PATH="$PATH:$HOME/bin"

fc

控制交互历史机制。fc是一个 ZShell 内置。我使用第四章中的fc来编辑nano中的命令。

$ type fc
fc is a shell builtin

$ man zshbuiltins | grep -A 10 '^ *fc '

find

在目录层次结构中搜索文件。find(版本 4.7.0)作者埃里克·b·德克尔、詹姆斯·杨曼、凯文·达利(2019)。更多信息:https://www.gnu.org/software/findutils

$ type find
find is /usr/bin/find

$ man find

$ find /data -type f -name '*.csv' -size -3
/data/ch03/tmnt-basic.csv
/data/ch03/tmnt-missing-newline.csv
/data/ch03/tmnt-with-header.csv
/data/ch05/irismeta.csv
/data/ch05/names-comma.csv
/data/ch05/names.csv
/data/ch07/datatypes.csv

fold

将每个输入行换行以适合指定的宽度。大卫·麦肯齐(David MacKenzie)著(2020 年)。更多信息:https://www.gnu.org/software/coreutils

$ type fold
fold is /usr/bin/fold

$ man fold

for

对列表中的每个成员执行命令。for是一个 ZShell 内置。在第八章中,我讨论了用parallel代替for的优势。

$ type for
for is a reserved word

$ man zshmisc | grep -EA 10 '^ *for '

$ for i in {A..C} "It's easy as" {1..3}; do echo $i; done
A
B
C
It's easy as
1
2
3

fx

交互式 JSON 查看器。fx(20.0.2 版),安东·梅德韦杰夫(2020 年)。更多信息:https://github.com/antonmedv/fx

$ type fx
fx is /usr/local/bin/fx

$ fx --help

$ echo '[1,2,3]' | fx 'this.map(x => x * 2)'
[
  2,
  4,
  6
]

git

愚蠢的内容跟踪器。Linus Torvalds 和 Junio C. Hamano (2021 年)编写的git(版本 2.25.1)。更多信息:https://git-scm.com

$ type git
git is /usr/bin/git

$ man git

grep

打印与图案匹配的行。grep(3.4 版)作者吉姆·迈耶林(2019)。更多信息:https://www.gnu.org/software/grep

$ type grep
grep is /usr/bin/grep

$ man grep

$ seq 100 | grep 3 | wc -l
19

gron

使 JSON greppable。gron(版本 0.6.1)作者汤姆·哈德森(2021)。更多信息:https://github.com/TomNomNom/gron

$ type gron
gron is /usr/bin/gron

$ man gron

head

输出文件的第一部分。head(8.30 版)作者大卫·麦肯齐和吉姆·迈耶林(2019)。更多信息:https://www.gnu.org/software/coreutils

$ type head
head is /usr/bin/head

$ man head

$ seq 100 | head -n 5
1
2
3
4
5

header

添加、替换和删除标题行。header(0.1 版)作者耶鲁安·扬森斯(2021)。更多信息:https://github.com/jeroenjanssens/dsutils

$ type header
header is /usr/bin/dsutils/header

history

GNU 历史图书馆。布莱恩·福克斯和切特·雷米(2020 年)。更多信息:https://www.gnu.org/software/bash

$ type history
history is a shell builtin

hostname

显示或设置系统的主机名。彼得·托拜厄斯、贝恩德·艾肯费尔斯和迈克尔·梅斯克斯(2021 年)。更多信息:https://sourceforge.net/projects/net-tools/

$ type hostname
hostname is /usr/bin/hostname

$ man hostname

$ hostname
b213d759a26c

$ hostname -i
172.17.0.2

in2csv

将常见但不太好的表格数据格式转换为 CSV 格式。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type in2csv
in2csv is /usr/bin/in2csv

$ in2csv --help

jq

命令行 JSON 处理器。jq(1.6 版)斯蒂芬·多兰(2021)。更多信息:https://stedolan.github.com/jq

$ type jq
jq is /usr/bin/jq

$ man jq

json2csv

将 JSON 转换为 CSV。json2csv(版本 1.2.1)作者 Jehiah Czebotar (2019)。更多信息:https://github.com/jehiah/json2csv

$ type json2csv
json2csv is /usr/bin/json2csv

$ json2csv --help

l

以长格式列出目录内容,目录在文件、可读文件大小和访问权限之前分组。l由未知(1999 年)。

$ type l
l is an alias for ls --color -lhF --group-directories-first

$ cd /data/ch03

$ ls
logs.tar.gz    tmnt-basic.csv            tmnt-with-header.csv
r-datasets.db  tmnt-missing-newline.csv  top2000.xlsx

$ l
total 924K
-rw-r--r-- 1 dst dst 627K Mar  3 11:02 logs.tar.gz
-rw-r--r-- 1 dst dst 189K Mar  3 11:02 r-datasets.db
-rw-r--r-- 1 dst dst  149 Mar  3 11:02 tmnt-basic.csv
-rw-r--r-- 1 dst dst  148 Mar  3 11:02 tmnt-missing-newline.csv
-rw-r--r-- 1 dst dst  181 Mar  3 11:02 tmnt-with-header.csv
-rw-r--r-- 1 dst dst  91K Mar  3 11:02 top2000.xlsx

less

更多的反义词。马克·努德尔曼(2019)著less(第 551 版)。更多信息:https://www.greenwoodsoftware.com/less

$ type less
less is an alias for less -R

$ man less

$ less README

ls

列出目录内容。ls(8.30 版)作者理查德·M·斯托曼和大卫·麦肯齐(2019)。更多信息:https://www.gnu.org/software/coreutils

$ type ls
ls is /usr/bin/ls

$ man ls

$ ls /data
ch02  ch03  ch04  ch05  ch06  ch07  ch08  ch09  ch10  csvconf

make

维护计算机程序的程序。斯图尔特·费尔德曼(Stuart I. Feldman)著(2020 年)。更多信息:https://www.gnu.org/software/make

$ type make
make is /usr/bin/make

$ man make

$ make sandwich

man

系统参考手册的界面。man(版本 2.9.1)作者约翰·w·伊顿和科林·沃森(2020)。更多信息:https://nongnu.org/man-db

$ type man
man is /usr/bin/man

$ man man

$ man excel
No manual entry for excel

mkdir

制作目录。mkdir(8.30 版)作者大卫·麦肯齐(2019)。更多信息:https://www.gnu.org/software/coreutils

$ type mkdir
mkdir is /usr/bin/mkdir

$ man mkdir

$ mkdir -p /data/ch{01..10}

mv

移动(重命名)文件。迈克·帕克,大卫·麦肯齐和吉姆·迈耶林(2020 年)。更多信息:https://www.gnu.org/software/coreutils

$ type mv
mv is /usr/bin/mv

$ man mv

$ mv results{,.bak}

nano

Nano 的另一个编辑器,灵感来自 Pico。Benno Schulenberg,David Lawrence Ramsey,Jordi Mallach,Chris Allegretta,Robert Siemborski 和 Adam Rogoyski (2020)的作品。更多信息:https://nano-editor.org

$ type nano
nano is /usr/bin/nano

nl

文件的行数。斯科特·巴特拉姆和大卫·麦肯齐(2020 年)。更多信息:https://www.gnu.org/software/coreutils

$ type nl
nl is /usr/bin/nl

$ man nl

$ nl /data/ch05/alice.txt | head
     1  Project Gutenberg's Alice's Adventures in Wonderland, by Lewis Carroll
     2
     3  This eBook is for the use of anyone anywhere at no cost and with
     4  almost no restrictions whatsoever.  You may copy it, give it away or
     5  re-use it under the terms of the Project Gutenberg License included
     6  with this eBook or online at www.gutenberg.org
     7
     8
     9  Title: Alice's Adventures in Wonderland
    10

parallel

从标准输入并行构建和执行 Shell 命令行。奥勒·葛覃(2016 年版)。更多信息:https://www.gnu.org/software/parallel

$ type parallel
parallel is /usr/bin/parallel

$ man parallel

$ seq 3 | parallel "echo Processing file {}.csv"
Processing file 1.csv
Processing file 2.csv
Processing file 3.csv

paste

合并文件行。paste(8.30 版)作者大卫·m·伊纳特和大卫·麦肯齐(2019)。更多信息:https://www.gnu.org/software/coreutils

$ type paste
paste is /usr/bin/paste

$ man paste

$ paste -d, <(seq 5) <(dseq 5)
1,2022-03-04
2,2022-03-05
3,2022-03-06
4,2022-03-07
5,2022-03-08

$ seq 5 | paste -sd+
1+2+3+4+5

pbc

平行公元前。耶鲁安·扬森斯(2021)。更多信息:https://github.com/jeroenjanssens/dsutils

$ type pbc
pbc is /usr/bin/dsutils/pbc

$ seq 3 | pbc '{1}^2'
1
4
9

pip

安装和管理 Python 包的工具。PyPA (2020 年)的pip(版本 20.0.2)。更多信息: https://pip.pypa.io

$ type pip
pip is /usr/bin/pip

$ man pip

$ pip install pandas

$ pip freeze | grep sci
scikit-learn==0.24.2
scipy==1.7.0

pup

在命令行解析 HTML。pup(版本 0.4.0)作者 Eric Chiang (2016)。更多信息:https://github.com/EricChiang/pup

$ type pup
pup is /usr/bin/pup

$ pup --help

pwd

打印工作目录的名称。pwd(8.30 版)作者吉姆·迈耶林(2019)。更多信息:https://www.gnu.org/software/coreutils

$ type pwd
pwd is a shell builtin

$ man pwd

$ cd ~

$ pwd
/home/dst

python

一种解释性的、交互式的、面向对象的编程语言。python(版本 3.8.5)由 Python 软件基金会(2021)提供。更多信息:https://www.python.org

$ type python
python is an alias for python3

$ man python

R

统计计算的语言和环境。R(版本 4.0.4)由 R 统计计算基金会(2021)提供。更多信息:https://www.r-project.org

$ type R
R is /usr/bin/R

$ man R

rev

逐字符反转行。rev(版本 2.36.1)作者卡雷尔·扎克(2021)。更多信息:https://www.kernel.org/pub/linux/utils/util-linux

$ type rev
rev is /usr/bin/rev

$ echo 'Satire: Veritas' | rev
satireV :eritaS

$ echo 'Ça va?' | rev | cut -c 2- | rev
Ça va

rm

删除文件或目录。保罗·鲁宾、大卫·麦肯齐、理查德·M·斯托曼和吉姆·迈耶林(2019 年)。更多信息:https://www.gnu.org/software/coreutils

$ type rm
rm is /usr/bin/rm

$ man rm

$ rm *.old

rush

来自 Shell 的 R 一行程序。rush(0.1 版)作者耶鲁安·扬森斯(2021)。更多信息:https://github.com/jeroenjanssens/rush

$ type rush
rush is /usr/local/lib/R/site-library/rush/exec/rush

$ rush --help

$ rush run '6*7'
42

$ rush run --tidyverse 'filter(starwars, species == "Human") %>% select(name)'
# A tibble: 35 x 1
   name
   <chr>
 1 Luke Skywalker
 2 Darth Vader
 3 Leia Organa
 4 Owen Lars
 5 Beru Whitesun lars
 6 Biggs Darklighter
 7 Obi-Wan Kenobi
 8 Anakin Skywalker
 9 Wilhuff Tarkin
10 Han Solo
# … with 25 more rows

sample

在给定的延迟和一定的持续时间内,根据某种概率从标准输入中过滤掉行。耶鲁安·扬森斯著(2021 年)。更多信息:https://github.com/jeroenjanssens/sample

$ type sample
sample is /usr/local/bin/sample

$ sample --help

$ seq 1000 | sample -r 0.01 | trim 5
893
912

scp

OpenSSH 安全文件复制。提莫·铃音和塔图·伊洛宁(2019 年)。更多信息:https://www.openssh.com

$ type scp
scp is /usr/bin/scp

$ man scp

sed

用于过滤和转换文本的流编辑器。杰伊·芬拉森、汤姆·洛德、肯·皮齐尼和保罗·邦奇尼(2018 年)。更多信息:https://www.gnu.org/software/sed

$ type sed
sed is /usr/bin/sed

$ man sed

seq

打印一系列数字。seq(8.30 版)作者:乌尔里希·德雷珀(2019)。更多信息:https://www.gnu.org/software/coreutils

$ type seq
seq is /usr/bin/seq

$ man seq

$ seq 3
1
2
3

$ seq 10 5 20
10
15
20

servewd

使用简单的 HTTP 服务器提供当前工作目录。servewd(0.1 版)作者耶鲁安·扬森斯(2021)。更多信息:https://github.com/jeroenjanssens/dsutils

$ type servewd
servewd is /usr/bin/dsutils/servewd

$ servewd --help

$ cd /data && servewd 8000

shuf

生成随机排列。保罗·埃格特著(2019 年)。更多信息:https://www.gnu.org/software/coreutils

$ type shuf
shuf is /usr/bin/shuf

$ man shuf

$ echo {a..z} | tr ' ' '\n' | shuf | trim 5
m
v
l
h
j
… with 21 more lines

$ shuf -i 1-100 | trim 5
56
8
7
88
4
… with 95 more lines

skll

sci kit-学习实验室。skll(版本 2.5.0)由教育测试服务(2021)提供。实际工具是run_experiment。我使用别名skll,因为我觉得更容易记住。更多信息:https://skll.readthedocs.org

$ type skll
skll is an alias for run_experiment

$ skll --help

sort

对文本文件行进行排序。迈克·哈尔特尔和保罗·埃格特(2019 年)。更多信息:https://www.gnu.org/software/coreutils

$ type sort
sort is /usr/bin/sort

$ man sort

$ echo '3\n7\n1\n3' | sort
1
3
3
7

split

把文件分成几部分。托尔比约恩·格兰隆德和理查德·M·斯托曼(2019 年)著split(版本 8.30)。更多信息:https://www.gnu.org/software/coreutils

$ type split
split is /usr/bin/split

$ man split

sponge

吸收标准输入并写入文件。科林·沃森和托勒夫·福格·希恩(2021 年)。如果您希望在单个管道中读取和写入同一个文件,这很有用。更多信息:https://joeyh.name/code/moreutils

$ type sponge
sponge is /usr/bin/sponge

sql2csv

对数据库执行 SQL 查询,并将结果输出到 CSV 文件。克里斯托弗·格罗斯科夫(Christopher Groskopf)著(2020 年)。更多信息:https://csvkit.rtfd.org

$ type sql2csv
sql2csv is /usr/bin/sql2csv

$ sql2csv --help

ssh

OpenSSH 远程登录客户端。ssh(版本 1:8.2p1-4ubuntu0.2)作者:塔图·伊洛宁、亚伦·坎贝尔、鲍勃·贝克、马库斯·弗里德尔、尼尔斯·普罗沃斯、西奥·拉阿德、达格·宋和马库斯·弗里德尔(2020)。更多信息:https://www.openssh.com

$ type ssh
ssh is /usr/bin/ssh

$ man ssh

sudo

作为另一个用户执行命令。sudo(版本 1.8.31)作者托德·c·米勒(2019)。更多信息: https://www.sudo.ws

$ type sudo
sudo is /usr/bin/sudo

$ man sudo

tail

输出文件的最后一部分。保罗·鲁宾、大卫·麦肯齐、伊恩·兰斯·泰勒和吉姆·迈耶林(2019 年)。更多信息:https://www.gnu.org/software/coreutils

$ type tail
tail is /usr/bin/tail

$ man tail

tapkee

一个高效的降维库。Sergey Lisitsyn、Christian Widmer 和 Fernando J. Iglesias Garcia (2013 年)撰写的tapkee(版本 1.2)。更多信息:http://tapkee.lisitsyn.me

$ type tapkee
tapkee is /usr/bin/tapkee

$ tapkee --help

tar

存档工具。约翰·吉尔摩和杰伊·芬拉森(2014 年)。更多信息:https://www.gnu.org/software/tar

$ type tar
tar is /usr/bin/tar

$ man tar

tee

从标准输入读取并写入标准输出和文件。迈克·帕克,理查德·M·斯托曼和大卫·麦肯齐(2019 年)。更多信息:https://www.gnu.org/software/coreutils

$ type tee
tee is /usr/bin/tee

$ man tee

telnet

TELNET 协议的用户界面。Mats Erik Andersson,Andreas Henriksson 和 Christoph Biedl (1999 年)。更多信息:http://www.hcs.harvard.edu/~dholland/computers/netkit.html

$ type telnet
telnet is /usr/bin/telnet

tldr

控制台命令的协作清单。tldr(版本 3.3.7)作者欧文·沃克(2021)。更多信息: https://tldr.sh

$ type tldr
tldr is /usr/local/bin/tldr

$ tldr --help

$ tldr tar | trim
✔ Page not found. Updating cache...
✔ Creating index...

  tar

  Archiving utility.
  Often combined with a compression method, such as gzip or bzip2.
  More information: https://www.gnu.org/software/tar.

  - [c]reate an archive and write it to a [f]ile:
    tar cf target.tar file1 file2 file3

… with 22 more lines

tr

翻译或删除字符。tr(8.30 版)作者吉姆·迈耶林(2018)。更多信息:https://www.gnu.org/software/coreutils

$ type tr
tr is /usr/bin/tr

$ man tr

tree

以树状格式列出目录的内容。tree(版本 1.8.0)作者史蒂夫·贝克(2018)。更多信息:https://launchpad.net/ubuntu/+source/tree

$ type tree
tree is /usr/bin/tree

$ man tree

$ tree / | trim
/
├── bin -> usr/bin
├── boot
├── data
│   ├── ch02
│   │   ├── fac.py
│   │   └── movies.txt
│   ├── ch03
│   │   ├── logs.tar.gz
│   │   ├── r-datasets.db
… with 121442 more lines

trim

将输出修剪到给定的高度和宽度。耶鲁安·扬森斯(2021)。更多信息:https://github.com/jeroenjanssens/dsutils

$ type trim
trim is /usr/bin/dsutils/trim

$ echo {a..z}-{0..9} | fold | trim 5 60
a-0 a-1 a-2 a-3 a-4 a-5 a-6 a-7 a-8 a-9 b-0 b-1 b-2 b-3 b-4…
c-0 c-1 c-2 c-3 c-4 c-5 c-6 c-7 c-8 c-9 d-0 d-1 d-2 d-3 d-4…
e-0 e-1 e-2 e-3 e-4 e-5 e-6 e-7 e-8 e-9 f-0 f-1 f-2 f-3 f-4…
g-0 g-1 g-2 g-3 g-4 g-5 g-6 g-7 g-8 g-9 h-0 h-1 h-2 h-3 h-4…
i-0 i-1 i-2 i-3 i-4 i-5 i-6 i-7 i-8 i-9 j-0 j-1 j-2 j-3 j-4…
… with 8 more lines

ts

时间戳输入。乔伊·赫斯(Joey Hess)著(2021)。更多信息:https://joeyh.name/code/moreutils

$ type ts
ts is /usr/bin/ts

$ echo seq 5 | sample -d 500 | ts
Mar 03 11:07:09 seq 5

type

显示命令行工具的类型和位置。type是一个 ZShell 内置。

$ type type
type is a shell builtin

$ man zshbuiltins | grep -A 10 '^ *type '

uniq

报告或省略重复的行。uniq(8.30 版)作者理查德·M·斯托曼和大卫·麦肯齐(2019)。更多信息:https://www.gnu.org/software/coreutils

$ type uniq
uniq is /usr/bin/uniq

$ man uniq

unpack

提取常见的文件格式。帕特里克·布里斯班(2013 年)。更多信息:https://github.com/jeroenjanssens/dsutils

$ type unpack
unpack is /usr/bin/dsutils/unpack

unrar

从 rar 档案中提取文件。本·阿瑟斯汀、克里斯蒂安·舍勒和约翰内斯·温克尔曼(2014 年)。更多信息:http://home.gna.org/unrar

$ type unrar
unrar is /usr/bin/unrar

$ man unrar

unzip

在 ZIP 存档中列出、测试和提取压缩文件。(版本 6.0)作者:塞缪尔·h·史密斯、埃德·戈登、克里斯蒂安·斯皮勒、翁诺·林登、麦克·怀特、凯·乌维·隆美尔、史蒂文·m·施韦达、保罗·基尼茨、克里斯·赫博斯、乔纳森·哈德森、塞尔吉奥·莫内西、哈拉尔德·登克、约翰·布什、亨特·戈特利、史蒂夫·索尔兹伯里、史蒂夫·米勒和戴夫·史密斯(2009)。更多信息:http://www.info-zip.org/pub/infozip

$ type unzip
unzip is /usr/bin/unzip

$ man unzip

vw

在线学习的快速机器学习库。约翰·兰福德(2021 年)。更多信息:https://vowpalwabbit.org

$ type vw
vw is /usr/local/bin/vw

$ vw --help --quiet

wc

打印每个文件的换行、字数和字节数。wc(8.30 版)作者保罗·鲁宾和大卫·麦肯齐(2019)。更多信息:https://www.gnu.org/software/coreutils

$ type wc
wc is /usr/bin/wc

$ man wc

which

找到一个命令。which(0.1 版本)由未知(2016)提供。更多信息:。

$ type which
which is a shell builtin

$ man which

xml2json

使用 xml 映射将 XML 输入转换为 JSON 输出。弗朗索瓦·帕门蒂尔(2016 年)。更多信息:https://github.com/parmentf/xml2json

$ type xml2json
xml2json is /usr/local/bin/xml2json

xmlstarlet

命令行 XML/XSLT 工具包。xmlstarlet(版本 1.6.1)作者:Dagobert Michelsen、Noam Postavsky 和 Mikhail Grushinskiy (2019)。更多信息:https://sourceforge.net/projects/xmlstar

$ type xmlstarlet
xmlstarlet is /usr/bin/xmlstarlet

$ man xmlstarlet

xsv

用 Rust 编写的快速 CSV 命令行工具包。xsv(0 . 13 . 0 版本)作者安德鲁·格兰特(2018)。更多信息:https://github.com/BurntSushi/xsv

$ type xsv
xsv is /usr/bin/xsv

$ xsv --help

zcat

解压缩并连接文件到标准输出。保罗·埃格特著(2021)。更多信息:https://www.nongnu.org/zutils/zutils.html

$ type zcat
zcat is /usr/bin/zcat

$ man zcat

zsh

ZShell。保罗·法尔斯塔德和彼得·斯蒂芬森(2020 年)。更多信息:https://www.zsh.org

$ type zsh
zsh is /usr/bin/zsh

$ man zsh
1
https://gitee.com/OpenDocCN/ds-cmd-line-2e-zh.git
git@gitee.com:OpenDocCN/ds-cmd-line-2e-zh.git
OpenDocCN
ds-cmd-line-2e-zh
ds-cmd-line-2e-zh
master

搜索帮助