Cron / Crontab Commands

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.

Command Options (10)

ShortcutAction
crontab -uSpecifies the name of the user whose crontab is to be modified. If this option is not used
crontab -TTest the crontab file syntax without installing it. Once an issue is found, the validation
crontab -lDisplays the current crontab on standard output
crontab -rRemoves the current crontab
crontab -eEdits the current crontab using the editor specified by the VISUAL or EDITOR environment
crontab -iThis option modifies the -r option to prompt the user for a 'y/Y' response before actually
crontab -sAppends the current SELinux security context string as an MLS_LEVEL setting to the crontab file
crontab -nThis option is relevant only if cron(8) was started with the -c option, to enable clustering
crontab -cThis option is only relevant if cron(8) was started with the -c option, to enable clustering
crontab -VPrint version and exit

Special Strings (7)

ShortcutAction
@rebootRun once after reboot
@yearlyRun once a year, ie. "0 0 1 1 *"
@annuallyRun once a year, ie. "0 0 1 1 *"
@monthlyRun once a month, ie. "0 0 1 * *"
@weeklyRun once a week, ie. "0 0 * * 0"
@dailyRun once a day, ie. "0 0 * * *"
@hourlyRun once an hour, ie. "0 * * * *"

Additional Shortcuts (5)

ShortcutAction
* * * * *min hr day mon dow
0 9 * * *Daily 9AM
*/5 * * * *Every 5 min
0 0 * * 0Every Sunday
0 0 1 * *Monthly 1st
📄 View Printable Cheat Sheet — Download as PDF or print · 🧩 Combine with other tools

Related Shortcut Pages

Bash / Shell Linux systemctl / systemd Zsh tmux Ansible

Search 18,500+ shortcuts across 268 platforms

Explore All Platforms Practice Shortcuts

Editing safely

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.

Reading the five fields

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.

Why the job worked in the shell but not in cron

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.

Frequently asked questions

How do I run a job every 15 minutes?

*/15 * * * * command. The slash means "every N" within the field's range.

What is the difference between @daily and 0 0 * * *?

None — @daily is an alias for exactly that line. @reboot is the only special string with no field equivalent.

Why does my cron job not run?

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.

How do I check a crontab for errors before installing it?

On cronie, crontab -T file validates the syntax. On other implementations, crontab -e reports errors when you save.

🤖 Ask AI about Cron / Crontab shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok
📜 Every shortcut on this page is taken from the official Cron / Crontab documentation — man7.org
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.