← 返回命令列表

Linux command

spark 命令

文本

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

常用示例

Generate a sparkline from numbers

spark [1] [5] [22] [13] [53]

Generate a sparkline from comma-separated input via stdin

echo "[1,2,3,4,5]" | spark

Generate a sparkline from a file

spark < [data.txt]

Visualize random data from a sequence

seq [100] | sort -R | head -20 | spark

Display help

spark -h

说明

spark generates sparkline graphs from a list of numbers, rendering them as Unicode block characters (▁▂▃▄▅▆▇█) in the terminal. Values are mapped proportionally across eight height levels, with the minimum value getting the shortest bar and the maximum the tallest. Numbers can be provided as command-line arguments, piped via stdin, or read from a file. Input supports comma-separated, space-separated, and newline-separated formats, making it easy to integrate with other Unix tools through pipes. The output is plain text using standard Unicode characters, so it works in any terminal that supports Unicode. Sparklines are useful for visualizing trends in data at a glance without requiring a full graphing tool.

FAQ

What is the spark command used for?

spark generates sparkline graphs from a list of numbers, rendering them as Unicode block characters (▁▂▃▄▅▆▇█) in the terminal. Values are mapped proportionally across eight height levels, with the minimum value getting the shortest bar and the maximum the tallest. Numbers can be provided as command-line arguments, piped via stdin, or read from a file. Input supports comma-separated, space-separated, and newline-separated formats, making it easy to integrate with other Unix tools through pipes. The output is plain text using standard Unicode characters, so it works in any terminal that supports Unicode. Sparklines are useful for visualizing trends in data at a glance without requiring a full graphing tool.

How do I run a basic spark example?

Run `spark [1] [5] [22] [13] [53]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more spark examples?

This page includes 5 examples for spark, plus related commands for nearby Linux tasks.