Linux: List / Display All Cron Jobs

Posted on in Categories , last updated May 3, 2017

How do I view currently setup or all running cron jobs under a Linux or Unix-like operating systems?

The cron service searches its spool area (usually /var/spool/cron/crontabs) for crontab files (which are named after user accounts); crontabs found are loaded into memory. cron also reads /etc/crontab, which is in a slightly different format. Additionally, cron reads the files in /etc/cron.d: it treats the files in /etc/cron.d as in the same way as the /etc/crontab file. The intended purpose of /etc/cron.d/ directory feature is to allow packages that require finer control of their scheduling than the /etc/cron.{daily,weekly,monthly} directories to add a crontab file to /etc/cron.d.

View Users Cronjob

Use the following syntax to view vivek users cronjob:

crontab -u userName -l
crontab -u vivek -l

View Root User Cronjob

Just type the following command:

crontab -l

View /etc/crontab

A cronjob can be also run from /etc/crontab file. To view it, enter:
# less /etc/crontab

View Daily Cronjob

Type the following commands:

cd /etc/cron.daily/
ls -l
cat filename

View Hourly Cronjobs

Type the following commands:

cd /etc/cron.hourly/
ls -l
cat filename

View Weekly Cronjobs

Type the following commands:

cd /etc/cron.weekly/
ls -l
cat filename

View Monthly Cronjobs

Type the following commands:

cd /etc/cron.monthly/
ls -l
cat filename

View Software (Package) Specific Cronjobs

Type the following commands

cd /etc/cron.d/
ls -l
cat filename
This entry is 5 of 15 in the Linux Cron Jobs Howto & Tutorial series. Keep reading the rest of the series:
  1. What is cron on a Linux or Unix-like systems?
  2. HowTo: Add Jobs To cron Under Linux or UNIX?
  3. Linux Verify crond Daemon And Cronjobs Are Running
  4. Linux Start Restart and Stop The Cron or Crond Service
  5. Linux: List / Display All Cron Jobs
  6. Linux / UNIX Crontab File Location
  7. Linux / UNIX: Change Crontab Email Settings ( MAILTO )
  8. Disable The Mail Alert By Crontab Command On a Linux or Unix-like Systems
  9. Linux: At What Time Cron Entries In cron.daily, cron.weekly, cron.monthly Run?
  10. Linux Execute Cron Job After System Reboot
  11. Linux / UNIX Setup and Run PHP Script As A Cron Job
  12. How to run crontab job every minute on a Linux or Unix-like system
  13. Run crontab (cron jobs) Every 10 Minutes
  14. Cron Job Script Execution on the Last Day of a Month
  15. Run crontab (cron jobs) every 1 minute

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

10 comment

  1. Thank you for a very good summary. If a cron task is required to be executed on a schedule other than hourly, daily, weekly, or monthly, it can be added to the /etc/cron.d/ directory.

  2. crontab -l just lists the jobs for the user who ran the command.

    So, to view root’s jobs, you’d either need to be logged in as root or run it with sudo.

  3. How do we check running cronjob process.
    I guess, its from ps -ef | grep file.sh

    or any other suggestion.

  4. How does one check the “version” of cron running? How can one know if their cron is a “vixie-style” crontab or not?

    1. Try the following:

      ## debian/ubuntu, see version and man page for syntax ##
       dpkg -p cron
       man cron
      ## RHEL/CentOS specific info ##
       yum info cronie
       man crond
      ## See man page
      
  5. I do this task manually
    ./getConfig ‘indirect’ ‘./(Command task)’ ‘./(Credential.csv’ ‘/usr/cronout/’ (standalone server)
    in command task there is a “cat /etc/ssh/sshd_config” but I saw blank sshd_config even though I can see details about sshd_config when I run those task manually. Can you help me?

Comments are closed.