← 返回命令列表

Linux command

faketime 命令

文本

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

常用示例

Example

faketime '[today 23:30]' [date]

Example

faketime '[yesterday]' [bash]

Example

faketime '[next Friday 1 am]' [path/to/program]

说明

faketime runs a command with a fake system time by intercepting time-related system calls. Useful for testing time-dependent software, debugging, and simulating future or past conditions. Uses LD_PRELOAD to intercept calls without modifying the actual system time.

参数

-f
Freeze time (don't advance)

FAQ

What is the faketime command used for?

faketime runs a command with a fake system time by intercepting time-related system calls. Useful for testing time-dependent software, debugging, and simulating future or past conditions. Uses LD_PRELOAD to intercept calls without modifying the actual system time.

How do I run a basic faketime example?

Run `faketime '[today 23:30]' [date]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f do in faketime?

Freeze time (don't advance)