• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

crontab Command Examples in Linux

by admin

The cron daemon is controlled using the crontab command. The command assumes the current user unless the -u option is specified. You can create, view, and delete crontab files using the crontab command.

Some of the options of the crontab command include:

Options Used To
-e Edit the crontab file for the current user.
-l View the crontab file for the current user.
-r Delete the current crontab file.
-u Create a crontab file on behalf of the specified user.

The syntax of the crontab command is:

# crontab [options] [file/ user]

crontab Command Examples

1. Edit the crontab file for the current user:

# crontab -e

2. Edit the crontab file for a specific user:

$ sudo crontab -e -u user

3. Replace the current crontab with the contents of the given file:

# crontab path/to/file

4. View a list of existing cron jobs for current user:

# crontab -l

5. Remove all cron jobs for the current user:

# crontab -r

6. Sample job which runs at 10:00 every day (* means any value):

0 10 * * * command_to_execute

7. Sample crontab entry, which runs a command every 10 minutes:

*/10 * * * * command_to_execute

8. Sample crontab entry, which runs a certain script at 02:30 every Friday:

30 2 * * Fri /absolute/path/to/script.sh

Filed Under: Linux

Some more articles you might also be interested in …

  1. sftp: command not found
  2. dvc destroy: Remove all DVC files and directories from a DVC project
  3. csh: The shell (command interpreter) with C-like syntax (Command Examples)
  4. Wallch (Wallpaper Changer) – Rotate Ubuntu Desktop Wallpapers
  5. RHEL / CentOS : How to rebuild LVM from Archive (metadata backups)
  6. mkfs.btrfs: command not found
  7. “aws s3” Command Examples
  8. debugfs: command not found
  9. rfkill: command not found
  10. xxd command – Expressed in hexadecimal form

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright