← 返回命令列表

Linux command

eg 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show

eg [command]

Show

eg git log

List

eg --list

Use a custom examples directory

eg --examples-dir [path/to/examples] [command]

Use a custom pager

eg --pager-cmd [less] [command]

说明

eg is a command-line tool that provides practical examples for common commands. Unlike traditional man pages that focus on comprehensive documentation, eg shows the most common and useful usage patterns with clear explanations. Written in Python, eg works out of the box with no configuration required. It depends only on standard Python libraries and supports both Python 2 and 3. Users can add custom examples by placing files in a custom directory alongside the built-in examples. The tool is particularly helpful for developers who know what they want to do but need a quick reminder of the exact syntax. It covers popular tools like git, docker, and many Unix utilities.

参数

--list
List all available commands with examples.
--color
Colorize output.
--squeeze
Remove blank lines from output.
--pager-cmd _PAGER_
Use specified pager program for output.
--examples-dir _DIR_
Use custom examples directory.
--custom-dir _DIR_
Use custom user-provided examples directory.
-v, --version
Display version and exit.
-h, --help
Display help and exit.

FAQ

What is the eg command used for?

eg is a command-line tool that provides practical examples for common commands. Unlike traditional man pages that focus on comprehensive documentation, eg shows the most common and useful usage patterns with clear explanations. Written in Python, eg works out of the box with no configuration required. It depends only on standard Python libraries and supports both Python 2 and 3. Users can add custom examples by placing files in a custom directory alongside the built-in examples. The tool is particularly helpful for developers who know what they want to do but need a quick reminder of the exact syntax. It covers popular tools like git, docker, and many Unix utilities.

How do I run a basic eg example?

Run `eg [command]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --list do in eg?

List all available commands with examples.