ustclug / Linux101-docs

Linux 101 学生课程教材与讲义
https://101.lug.ustc.edu.cn
Creative Commons Attribution Share Alike 4.0 International
664 stars 64 forks source link

Ch03: fix typo and perf tldr install #33

Closed Flurry-L closed 1 year ago

Flurry-L commented 1 year ago

使用 ubuntu 实测 apt 下载的 tldr,发现其并没有包含数据,所以在 install 中加入了 tldr -u 以更新。

taoky commented 1 year ago

Ubuntu 20.04 的 tldr:

root@1ccf0beeeb0f:/# tldr ls
Cloning into 'tldr'...
remote: Enumerating objects: 79358, done.
remote: Counting objects: 100% (202/202), done.
remote: Compressing objects: 100% (156/156), done.
remote: Total 79358 (delta 94), reused 130 (delta 46), pack-reused 79156
Receiving objects: 100% (79358/79358), 19.10 MiB | 8.17 MiB/s, done.
Resolving deltas: 100% (47606/47606), done.
ls
List directory contents.More information: https://www.gnu.org/software/coreutils/ls.

 - List files one per line:
   ls -1

 - List all files, including hidden files:
   ls -a

 - List all files, with trailing / added to directory names:
   ls -F

 - Long format list (permissions, ownership, size, and modification date) of all files:
   ls -la

 - Long format list with size displayed using human-readable units (KiB, MiB, GiB):
   ls -lh

 - Long format list sorted by size (descending):
   ls -lS

 - Long format list of all files, sorted by modification date (oldest first):
   ls -ltr

 - Only list directories:
   ls -d */
root@1ccf0beeeb0f:/# tldr -u
Invalid option `-u'

Did you mean one of these?
    -h
    -v

Usage: tldr [-v|--version] [--update] COMMAND
  tldr Client program

Ubuntu 22.04 的 tldr:

root@3ae5fe7d59a9:/# tldr ls
No tldr entry for ls
root@3ae5fe7d59a9:/# tldr -u
tldr: /root/.local/share/tldr: createDirectory: does not exist (No such file or directory)
root@3ae5fe7d59a9:/# mkdir ~/.local
root@3ae5fe7d59a9:/# tldr -u
tldr: /root/.local/share/tldr: createDirectory: does not exist (No such file or directory)
root@3ae5fe7d59a9:/# mkdir ~/.local/share
root@3ae5fe7d59a9:/# tldr -u
Cloning into 'tldr'...
remote: Enumerating objects: 79358, done.
remote: Counting objects: 100% (203/203), done.
remote: Compressing objects: 100% (157/157), done.
remote: Total 79358 (delta 95), reused 130 (delta 46), pack-reused 79155
Receiving objects: 100% (79358/79358), 19.09 MiB | 6.94 MiB/s, done.
Resolving deltas: 100% (47605/47605), done.
root@3ae5fe7d59a9:/# tldr ls
ls
List directory contents.More information: https://www.gnu.org/software/coreutils/ls.

 - List files one per line:
   ls -1

 - List all files, including hidden files:
   ls -a

 - List all files, with trailing / added to directory names:
   ls -F

 - Long format list (permissions, ownership, size, and modification date) of all files:
   ls -la

 - Long format list with size displayed using human-readable units (KiB, MiB, GiB):
   ls -lh

 - Long format list sorted by size (descending):
   ls -lS

 - Long format list of all files, sorted by modification date (oldest first):
   ls -ltr

 - Only list directories:
   ls -d */

看起来是版本更新带来的问题。

taoky commented 1 year ago

可以改成 tldr --update,这个在 20.04 和 22.04 的 tldr 里都是可用的。

See: