at command is a command-line utility that is used to schedule a command to be executed at a particular time in the future. Jobs created with at command are executed only once. The at command can be used to execute any program or mail at any time in the future. It executes commands at a particular time and accepts times of the form HH:MM to run a job at a specific time of day. The following expression like noon, midnight, teatime, tomorrow, next week, next Monday, etc. could be used with at command to schedule a job.
Syntax:
at [OPTION...] runtime
Installation of at command
For Ubuntu/Debian :
sudo apt-get update
sudo apt-get install at
For CentOS/Fedora :
sudo yum install at
Working with at command
1. Command to list the userâs pending jobs:
at -l
or
atq

2. Schedule a job for the coming Monday at a time twenty minutes later than the current time:
at Monday +20 minutes
3. Schedule a job to run at 1:45 Aug 12 2020:
at 1:45 081220
4. Schedule a job to run at 3pm four days from now:
at 3pm + 4 days
5. Schedule a job to shutdown the system at 4:30 today:
# echo "shutdown -h now" | at -m 4:30
6. Schedule a job to run five hour from now:
at now +5 hours

7. at -r or atrm command is used to deletes job , here used to deletes job 11 .
at -r 11
or
atrm 11

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!
Looking for a place to share your ideas, learn, and connect? Our Community portal is just the spot! Come join us and see what all the buzz is about!
Last Updated :
03 Jul, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...