在 Ubuntu 系统中,你可以使用多种方法来生成时间戳。以下是一些常用的方法:
使用 date
命令:
date +%s
date +%s%3N
使用 python
脚本:
python -c 'import time; print(int(time.time()))'
python -c 'import time; print(int(time.time() * 1000))'
使用 perl
脚本:
perl -MTime::HiRes -e 'printf("%d\n", Time::HiRes::time())'
这些方法都可以在终端中直接运行,以获取当前的时间戳。选择适合你的需求和环境的方法即可。