← 返回命令列表

Linux command

lolcat 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Print text in rainbow colors

echo "Hello World" | lolcat

Display a file

lolcat [file]

Animate the rainbow effect

echo "Animated!" | lolcat -a

Adjust animation speed

echo "Fast rainbow" | lolcat -a -d [1]

Set the rainbow spread

lolcat -p [3.0] [file]

Force color output

lolcat -f [file] | less -R

说明

lolcat concatenates files or standard input to standard output, adding a rainbow color gradient. It works like cat but applies ANSI color codes for a colorful twist to terminal output. Commonly paired with ASCII art generators like figlet or cowsay, lolcat is popular for creating visually striking terminal outputs, system banners, and adding personality to shell scripts.

参数

-a, --animate
Animate the rainbow effect
-d _duration_, --duration _duration_
Animation duration in seconds per line (default: 12)
-s _speed_, --speed _speed_
Animation speed (default: 20.0)
-p _spread_, --spread _spread_
Rainbow spread (default: 3.0)
-F _freq_, --freq _freq_
Rainbow frequency (default: 0.1)
-S _seed_, --seed _seed_
Rainbow seed, 0 = random (default: 0)
-i, --invert
Invert foreground and background
-t, --truecolor
Use 24-bit truecolor (default on supported terminals)
-f, --force
Force color output even when stdout is not a terminal
-h, --help
Display help message
-v, --version
Print version and exit

FAQ

What is the lolcat command used for?

lolcat concatenates files or standard input to standard output, adding a rainbow color gradient. It works like cat but applies ANSI color codes for a colorful twist to terminal output. Commonly paired with ASCII art generators like figlet or cowsay, lolcat is popular for creating visually striking terminal outputs, system banners, and adding personality to shell scripts.

How do I run a basic lolcat example?

Run `echo "Hello World" | lolcat` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --animate do in lolcat?

Animate the rainbow effect