Complete Cron / Crontab commands reference — 22 commands across 3 categories. Quick reference cheat sheet for Linux & Unix.
cron has two halves that are easy to confuse: the crontab command that installs and edits schedules, and the five-field schedule syntax inside the file it edits. The table covers both, using the cronie implementation that ships with Fedora, RHEL and most current distributions; the schedule syntax itself has been stable for decades and works on any Unix.
| Shortcut | Action |
|---|---|
| crontab -u | Specifies the name of the user whose crontab is to be modified. If this option is not used |
| crontab -T | Test the crontab file syntax without installing it. Once an issue is found, the validation |
| crontab -l | Displays the current crontab on standard output |
| crontab -r | Removes the current crontab |
| crontab -e | Edits the current crontab using the editor specified by the VISUAL or EDITOR environment |
| crontab -i | This option modifies the -r option to prompt the user for a 'y/Y' response before actually |
| crontab -s | Appends the current SELinux security context string as an MLS_LEVEL setting to the crontab file |
| crontab -n | This option is relevant only if cron(8) was started with the -c option, to enable clustering |
| crontab -c | This option is only relevant if cron(8) was started with the -c option, to enable clustering |
| crontab -V | Print version and exit |
| Shortcut | Action |
|---|---|
| @reboot | Run once after reboot |
| @yearly | Run once a year, ie. "0 0 1 1 *" |
| @annually | Run once a year, ie. "0 0 1 1 *" |
| @monthly | Run once a month, ie. "0 0 1 * *" |
| @weekly | Run once a week, ie. "0 0 * * 0" |
| @daily | Run once a day, ie. "0 0 * * *" |
| @hourly | Run once an hour, ie. "0 * * * *" |
| Shortcut | Action |
|---|---|
| * * * * * | min hr day mon dow |
| 0 9 * * * | Daily 9AM |
| */5 * * * * | Every 5 min |
| 0 0 * * 0 | Every Sunday |
| 0 0 1 * * | Monthly 1st |
crontab -e opens your crontab in $EDITOR and installs it on save; crontab -l prints the current one, and piping that to a file before editing is the only backup you get. crontab -r removes the whole crontab with no confirmation — it sits one key away from -e on the keyboard, which is why crontab -i exists to add a prompt. On cronie, crontab -T syntax-checks a file without installing it, and crontab -u lets root edit another user's schedule.
A line is minute, hour, day of month, month, day of week, then the command: * * * * * runs every minute, 0 9 * * * at 09:00 daily, */5 * * * * every five minutes, 0 0 * * 0 at midnight on Sundays and 0 0 1 * * at midnight on the first of the month. Day of month and day of week are combined with OR when both are set, which surprises people who write "the first Monday" and get every Monday plus every first. The @ strings are aliases for common lines — @daily, @hourly, @weekly — and @reboot runs once when the daemon starts, which has no five-field equivalent.
Cron runs commands with a minimal environment: a short PATH, no shell profile, and /bin/sh rather than your login shell. Use absolute paths for commands and files, redirect output somewhere (>> /var/log/job.log 2>&1) or it is mailed to the user and silently lost, and remember that a percent sign in the command is a newline unless escaped. Times are in the system timezone unless the implementation supports a CRON_TZ variable at the top of the file.
*/15 * * * * command. The slash means "every N" within the field's range.
None — @daily is an alias for exactly that line. @reboot is the only special string with no field equivalent.
Usually the environment: use absolute paths, redirect output to a log to see errors, and check the system log for the cron daemon's entries. crontab -l confirms the schedule is installed.
On cronie, crontab -T file validates the syntax. On other implementations, crontab -e reports errors when you save.
Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"