Session and utilities
The at command
Schedules a command to run once at a specific time, even after you log out. The atd daemon runs it, so atd has to be active.
Most useful options
-f <archivo>Reads the commands from a file instead of asking for them at the keyboard-mSends mail when the job finishes, even if it has no output-lLists pending jobs, the same as atq-d <número>Deletes a pending job, the same as atrm-c <número>Shows the exact script that job will run-t <AAAAMMDDhhmm>Date and time in fixed format, useful from a scriptCopy-ready examples
$ echo 'tar -czf /tmp/copia.tgz ~/Documentos' | at 03:00schedules a backup for 3 a.m., with the command piped in.Example output
job 12 at Wed Nov 4 03:00:00 2026
$ at now + 10 minutesopens an interactive prompt: you type the commands, press Ctrl+D and they are scheduled.$ at -f limpieza.sh 23:30runs the limpieza.sh script tonight at 23:30.Example output
job 13 at Tue Nov 3 23:30:00 2026
$ atqlists pending jobs: number, date, queue and user.Example output
12 Wed Nov 4 03:00:00 2026 a miguel 13 Tue Nov 3 23:30:00 2026 a miguel
$ atrm 12cancels job 12, which will not run.$ at -c 13shows the script job 13 will run, before you trust it.You can try them in the browser terminal: it does not touch your computer.
Common errors
| Message | Cause | Fix |
|---|---|---|
| Garbled time | at does not understand the time: you wrote a format it does not recognize, such as 25:00. | Use clear formats: 17:30, now + 10 minutes, midnight, teatime or tomorrow. |
Typical mistakes
- at does not repeat: a job runs once. For recurring tasks use crontab.
- If atd is not running, at accepts the job but nothing runs. Check with systemctl status atd.
- The command runs with the environment and directory you had when you scheduled it.
Differences from similar commands
Security
at runs commands without you in front of the machine, with your permissions. A forgotten job can run weeks later. Check atq now and then, and limit who can use it with /etc/at.allow or /etc/at.deny.
FAQ
How do I see what I scheduled?
atq lists the pending jobs. at -c NUMBER shows the exact script that will run.
How do I cancel a job?
With atrm NUMBER. Check the number with atq first.
Why did my job do nothing?
Usually one of these: atd is not running, the output was not saved anywhere, or the command uses relative paths that do not exist when it runs.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course