This tutorial explains Linux “sleep” command, options and its usage with examples.
sleep – delay for a specified amount of time.
DESCRIPTION
`sleep’ pauses for an amount of time specified by the sum of the values of the command line arguments.
SYNOPSIS
sleep NUMBER[smhd]…
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
advertisement
advertisement
SUFFIX may be `s’ for seconds (the default), `m’ for minutes, `h’ for hours or `d’ for days. Unlike most implementations that require NUMBER be an integer, here NUMBER may be an arbitrary floating point number.
EXAMPLE
To incorporate pause for 5 seconds or 2 minutes in my bash shell script
Check this: Information Technology Books | Programming MCQs
To sleep for 5 seconds, use:
sleep 5
To sleep for 2 mintus, use:
advertisement
sleep 2m
sleep Command Bash Script Example
#!/bin/bash echo "Hi, I'm sleeping for 5 seconds..." sleep 5 echo "I'm awake Now."
Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.
advertisement
If you wish to look at all Linux commands and their usage examples, go to Linux Commands Tutorial.
Related Posts:
- Practice Programming MCQs
- Buy Linux Books
- Apply for Programming Internship
- Apply for Linux Internship
- Buy Information Technology Books