What commands can I use in Terminal to see pending or scheduled tasks for today or tomorrow.

For example how can I detect pending system shutdown?

1 Answer 1


There is util called cron. Usually cron handle task scheduling in Linux. But there is also few another ways to do it.

In case of cron, you can just run crontab -l to see all task scheduled by current user.

If you want to check task for another user use -u $username key

TO check root user tasks: sudo crontab -u root -l

To understand crontab format please read wiki

If you want to detect exactly system shutdown

The one of possible solutions is to wrap shutdown command in a script.

Another solution is to write a trap detecting SIGTERM signal, but this solution do not give you time when system will start halting. Read about trap here

Also there is another one tricky solution:

If you run sudo shutdown -r 20:00, you spawn a process that will start shutdown at 20:00.

You can find this process using ps

$ ps -ef | grep shutdown
root     32222 32032  0 15:55 pts/8    00:00:00 sudo shutdown -r 20:00
root     32223 32222  0 15:55 pts/8    00:00:00 shutdown -r 20:00
c0rp     32382 32233  0 15:55 pts/10   00:00:00 grep --color=auto shutdown

And you can see a time here. If you kill this process, shutdown will be canceled

  • thanks for the link to wiki documentation its helpful but for example I just run sudo shutdown -r 20:00 for example and when I run any of your suggested commands it says no crontab for root so my question is how can I list command like that in case I forgot about that it was supposed to restart at 20:00 or any other hour.
    – JoKeR
    Apr 5, 2014 at 9:35
  • Thank you! ps works just great :-)
    – JoKeR
    Apr 5, 2014 at 10:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .