# man > crontab(5)

---
type: CommandReference
command: crontab
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `crontab -e` — edit the crontab file for the current user
- `crontab -e -u <user>` — edit crontab for a specific user (requires sudo)
- `crontab <file>` — replace current crontab with contents of given file
- `crontab -l` — list current crontab
- `crontab -r` — remove all cron jobs for current user
- `crontab -i -r` — remove with confirmation prompt
- `0 10 * * * <command>` — run at 10:00 every day
- `*/10 * * * * <command>` — run every 10 minutes

## Name

crontab - maintain crontab files for individual users (Vixie Cron)

## Synopsis

`crontab [ -u user ] file`
`crontab [ -u user ] [ -i ] { -e | -l | -r }`

## Options

- `-u` — specify user whose crontab is to be used (default: current user)
- `-e` — edit current crontab using VISUAL or EDITOR, then install automatically
- `-l` — display current crontab on stdout. In Debian, does not output the DO NOT EDIT header by default (set `CRONTAB_NOHEADER='N'` to restore header)
- `-r` — remove current crontab
- `-i` — interactive prompt before removal (modifies -r)
- `file` — install crontab from file; use `-` for stdin

**Access control:** `/etc/cron.allow` (allowlist) takes precedence over `/etc/cron.deny` (denylist). If neither exists, behavior is site-dependent; root is always allowed. On Debian, all users may use crontab by default.

## Examples

shell
# Edit crontab for current user
crontab -e

# Edit crontab for user 'root' (requires sudo)
sudo crontab -e -u root

# Replace current crontab with contents of file
crontab /path/to/file

# List current crontab
crontab -l

# Remove all cron jobs for current user
crontab -r

# Remove with confirmation prompt
crontab -i -r

# Sample: run at 10:00 every day
0 10 * * * /path/to/command

# Sample: run every 10 minutes
*/10 * * * * /path/to/command

# Sample: run at 02:30 every Friday
30 2 * * Fri /path/to/script.sh
## See Also

- [crontab(5)](https://www.chedong.com/phpMan.php/man/crontab/5/markdown) — crontab file format
- [cron(8)](https://www.chedong.com/phpMan.php/man/cron/8/markdown) — cron daemon

## Files

- `/etc/cron.allow`
- `/etc/cron.deny`
- `/var/spool/cron/crontabs/` — directory containing user crontabs (not to be edited directly)

Note: The crontab command enforces syntax validity and permissions via setgid on the crontab group.