Skip to content

Instantly share code, notes, and snippets.

@ejhayes
Last active December 15, 2015 05:29
Show Gist options
  • Save ejhayes/5209406 to your computer and use it in GitHub Desktop.
Save ejhayes/5209406 to your computer and use it in GitHub Desktop.
For each user listed grab a list of their cronjobs and display back to the screen.
#!/bin/bash
cat /etc/passwd | sed -e "s/\([^:]\+\).*/\1/" | xargs -I user bash -c "echo user && su user -c \"crontab -l\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment