← 返回命令列表

Linux command

imgcat 命令

文本

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

常用示例

Display an image

imgcat [path/to/image.png]

Display multiple images

imgcat [image1.jpg] [image2.png]

Display image from URL

curl -s [https://example.com/image.jpg] | imgcat

Display with specific width

imgcat -w [80] [image.png]

Display at specific height

imgcat -H [24] [image.png]

Read image from stdin

curl -s [https://example.com/image.jpg] | imgcat -

说明

imgcat displays images inline in the terminal. Multiple implementations exist: the original iTerm2 shell script uses the iTerm2 inline images protocol, while standalone versions (such as the one from posva or the one bundled with iTerm2) support additional options. The image is encoded in base64 and sent via escape sequences, rendering inline with text output. This allows quick image previewing during development, viewing images over SSH sessions, and integrating visual output into command-line workflows. Note that there are several distinct tools named "imgcat" with different flag sets. The parameters listed here reflect common options but may vary by implementation.

参数

-w, --width _n_
Output width in character cells.
-H, --height _n_
Output height in character cells.
-R, --no-stretch
Do not stretch the image to fill the available space.
--version
Show version information.
--help
Show help.

FAQ

What is the imgcat command used for?

imgcat displays images inline in the terminal. Multiple implementations exist: the original iTerm2 shell script uses the iTerm2 inline images protocol, while standalone versions (such as the one from posva or the one bundled with iTerm2) support additional options. The image is encoded in base64 and sent via escape sequences, rendering inline with text output. This allows quick image previewing during development, viewing images over SSH sessions, and integrating visual output into command-line workflows. Note that there are several distinct tools named "imgcat" with different flag sets. The parameters listed here reflect common options but may vary by implementation.

How do I run a basic imgcat example?

Run `imgcat [path/to/image.png]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -w, --width _n_ do in imgcat?

Output width in character cells.