Files
tldr/pages.zh/linux/faketime.md

16 lines
415 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# faketime
> 假装命令的系统时间。
> 更多信息:<https://manned.org/faketime>。
- 将时间伪装为今晚,在打印 `date` 的结果之前:
`faketime '{{today 23:30}}' {{date}}`
- 打开一个新的 Bash shell将昨天作为当前日期
`faketime '{{yesterday}}' {{bash}}`
- 模拟一个程序在下周五晚上会如何运行:
`faketime '{{next Friday 1 am}}' {{path/to/program}}`