at
process managementlinux
The at command is one of the most frequently used commands in Linux/Unix-like operating systems. at The at command is used to schedule commands to be executed once at a later time. Unlike cron, which is used for recurring tasks, at is ideal for one-time scheduled tasks.
Quick Reference
Command Name:
at
Category:
process management
Platform:
linux
Basic Usage:
at [options] [arguments]
Common Use Cases
Syntax
at [-V] [-q queue] [-f file] [-mMlv] timespec... at [-V] [-q queue] [-f file] [-mMkv] [-t time]
Options
Option | Description |
---|---|
-V | Output version information |
-q queue | Use the specified queue (a single letter from a to z; a is highest priority) |
-f file | Read the job from file rather than standard input |
-m | Send mail to the user when the job has completed |
-M | Never send mail to the user, even when output exists |
-l | Output a list of all jobs (same as atq) |
-d job [job...] | Remove the specified jobs (same as atrm) |
-v | Show the time the job will be executed before reading the job |
-c job | Print the job listed by atq to standard output |
-t time | Run the job at the time specified in the format [[CC]YY]MMDDhhmm[.ss] |
Examples
How to Use These Examples
The examples below show common ways to use the at
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
#
# Schedule a command for tomorrow at 3 AM
at 3am tomorrow
/home/user/backup.sh
[Ctrl+D]Basic Examples:
# Schedule a command to run at 2 PM today at 2pm echo "Hello, world!" > /tmp/at_test.txt [Ctrl+D]
Advanced Examples:
# Schedule a job with specific environment settings at -v 2pm tomorrow