Linux command
sleep 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
sleep [seconds]
Example
sleep [minutes]m
Example
sleep 1d 3h
Example
sleep 20m && [command]
Example
sleep infinity
Example
sleep --help
说明
sleep pauses execution for a specified amount of time. It accepts floating-point numbers and multiple time arguments which are summed together. The command is commonly used in shell scripts to add delays between operations or to wait for external processes. GNU sleep supports time suffixes (s, m, h, d) and the special value infinity for indefinite pausing. Multiple arguments are added together, allowing expressions like sleep 1h 30m for 90 minutes.
参数
- NUMBER
- Amount of time to sleep
- s
- Seconds (default if no suffix)
- m
- Minutes
- h
- Hours
- d
- Days
- infinity / inf
- Sleep forever (until interrupted)
- --help
- Display help and exit
- --version
- Output version information and exit
FAQ
What is the sleep command used for?
sleep pauses execution for a specified amount of time. It accepts floating-point numbers and multiple time arguments which are summed together. The command is commonly used in shell scripts to add delays between operations or to wait for external processes. GNU sleep supports time suffixes (s, m, h, d) and the special value infinity for indefinite pausing. Multiple arguments are added together, allowing expressions like sleep 1h 30m for 90 minutes.
How do I run a basic sleep example?
Run `sleep [seconds]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does NUMBER do in sleep?
Amount of time to sleep