← 返回命令列表

Linux command

tock 命令

文本

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

常用示例

Display a centered 24-hour clock with seconds

tock -s -m -c

Custom color and font dimensions

tock -C [4] -W [3] -H [2]

Custom date format

tock -f "[%A, %B %d]"

说明

tock is a digital clock for the terminal inspired by tty-clock. It supports customizable positioning, font sizing, 12/24-hour modes, color selection, seconds display, and date formatting.

参数

-s, --second
Display seconds.
-m, --military
Use 24-hour (military) time format.
-c, --center
Center the clock in the terminal (overrides manual positioning).
-C, --color _COLOR_
Set the clock color using an ANSI value 0-7 (default: 2).
-x, --x _X_
Horizontal 0-indexed position of the clock's top-left corner (default: 0).
-y, --y _Y_
Vertical 0-indexed position of the clock's top-left corner (default: 0).
-W, --width _WIDTH_
Font width in characters per tile (default: 2).
-H, --height _HEIGHT_
Font height in characters per tile (default: 1).
-f, --format _FORMAT_
Custom date format string (default: "%F | %Z").
-h, --help
Display help information.

FAQ

What is the tock command used for?

tock is a digital clock for the terminal inspired by tty-clock. It supports customizable positioning, font sizing, 12/24-hour modes, color selection, seconds display, and date formatting.

How do I run a basic tock example?

Run `tock -s -m -c` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -s, --second do in tock?

Display seconds.