Skip to content

cmd - 忘记命令用法

::: warning 问题描述 在使用命令时,长时间不使用,难免会有忘记的时候 :::

这要分开几种情况进行讨论:

忘记是哪个命令了

有时候,只记得命令的作用,但是已经不知道命令的拼读了,那么可以使用apropos命令,apropos会搜索手册

 - Search for a keyword using a regular expression:
   apropos {{regular_expression}}

 - Search without restricting the output to the terminal width:
   apropos -l {{regular_expression}}

 - Search for pages that contain all the expressions given:
   apropos {{regular_expression_1}} -a {{regular_expression_2}} -a {{regular_expression_3}}

例子:

$ apropos find
ack (1p)             - grep-like text finder
btrfs-find-root (8)  - filter to find btrfs root
fdfind (1)           - find entries in the filesystem
ffs (3)              - find first bit set in a word
ffsl (3)             - find first bit set in a word
ffsll (3)            - find first bit set in a word
File::IconTheme (3pm) - Find icon directories
File::MimeInfo::Applications (3pm) - Find programs to open a file by mimetype
File::Next (3pm)     - File-finding iterator
File::UserDirs (3pm) - Find extra media and documents directories
find (1)             - search for files in a directory hierarchy
findfs (8)           - find a filesystem by label or UUID
findmnt (8)          - find a filesystem
git-bisect (1)       - Use binary search to find the commit that introduced a bug
git-cherry (1)       - Find commits yet to be applied to upstream
xdg-user-dir (1)     - Find an XDG user dir

忘记命令参数用法

tldr命令意思是too long; didn't read官方文档太长了,不想看,那么可以使用tldr快速查看其用法

 - Show the tldr page for a command (hint: this is how you got here!):
   tldr {{command}}

 - Show the tldr page for cd, overriding the default platform:
   tldr -p {{android|linux|osx|sunos|windows}} {{cd}}

 - Show the tldr page for a subcommand:
   tldr {{git-checkout}}

 - Update local pages (if the client supports caching):
   tldr -u