Quick take: The at command schedules a command to run once at a future time: at 14:30 then type the command and press Ctrl+D. List pending jobs with atq and remove one with atrm. Use cron for recurring jobs and at for one-offs.
Introduction
While cron handles recurring schedules, the at command runs a command once at a specified time — perfect for a one-off task like restarting a service tonight or sending a reminder later. You enter the time, type the commands interactively, and the system runs them when the moment arrives.
Syntax
The basic syntax of the at command is:
at TIME
# (type commands, then Ctrl+D)Common Options and Parameters
The most useful options and parameters for the at command:
| Option | Description |
|---|---|
| at TIME | Schedule jobs to run at TIME (e.g. 14:30, now + 1 hour). |
| at -f FILE TIME | Run the commands from a file. |
| atq | List pending at jobs. |
| atrm N | Remove pending job number N. |
| at -l / -d | List jobs / delete a job (aliases). |
| -m | Email the user when the job completes. |
Practical Examples
Real at commands you can run today:
# Schedule a job for 2:30 PM
at 14:30
# Run something in one hour
at now + 1 hour
# Schedule for tomorrow morning
at 9am tomorrow
# Run commands from a file at a time
at -f script.sh 22:00
# List pending jobs
atq
# Remove a pending job
atrm 3Tips and Best Practices
- After running
at TIME, type your commands and press Ctrl+D to finish entering them. - at accepts flexible times:
now + 30 minutes,midnight,9am tomorrow, or10:00 AM Jul 4. - The
atdaemon (atd) must be running and the package installed (sudo apt install at) for jobs to execute.
Final Thoughts
at is the tool for one-off scheduling — run a command once at a future time, then forget it. Manage the queue with atq and atrm, and remember Ctrl+D ends command entry. Where cron repeats on a schedule, at fires a single time, making the two complementary halves of Linux job scheduling.
FAQ: at Command in Linux
How do I schedule a one-time job in Linux?+
Use at with a time, like at 14:30, then type the commands and press Ctrl+D. The job runs once at that time. Use cron instead for recurring jobs.
What time formats does at accept?+
at is flexible: at now + 1 hour, at 9am tomorrow, at midnight, or at 10:00 AM Jul 4 all work. You can combine a time and a date.
How do I list and remove pending at jobs?+
Use atq to list pending jobs with their numbers, and atrm N (or at -d N) to remove a specific one before it runs.
What is the difference between at and cron?+
at schedules a command to run once at a future time, while cron runs commands repeatedly on a recurring schedule. Use at for one-offs and cron for anything that repeats.
Why isn't my at job running?+
The at daemon (atd) must be installed and running. Install it with sudo apt install at and ensure the service is active. Also check that your user is permitted to use at.
Need help with Linux servers or infrastructure?
Work directly with Muhammad Irfan Aslam for Linux, Ubuntu, Docker, DevOps, cloud, CI/CD, or infrastructure support.
Hire Me for Support