I had the need recently to find a cron job on a server. I was logged in as root, but I didn’t know who the cron job was set up as.

You can get a list of all users who have cron scheduled tasks by running the following command:

This allows you to see the users, although if you’ve got a general idea, then looking in /etc/passwd would give you an idea too.

So, the cronjob might be running as any of these users. Usually to get your crontab you can just run:

Or to edit it:

As root, you get the chance to tell crontab which user you’d like to view. Like this:

Image Credit: jlcwalker