Skip to content

Instantly share code, notes, and snippets.

@mims92
Created December 6, 2017 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mims92/2ea5c2ce4eda408208813df71323e251 to your computer and use it in GitHub Desktop.
Save mims92/2ea5c2ce4eda408208813df71323e251 to your computer and use it in GitHub Desktop.
Linux - Bash - List all crontab for all users
####################################################################################################################
# From https://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users#comment81662841_44714620
# Tested on Debian 8
####################################################################################################################
#!/bin/bash
cat /etc/passwd | sed 's/^\([^:]*\):.*$/echo "\ncrontab for \1:"; crontab -u \1 -l 2>\&1/' | grep -v "no crontab for" | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment