What happens when I type just "crontab -"? The "e" didn't take before I hit Enter. It just moved the cursor to the next line and I had to Ctrl+C to exit, but I'm not sure what it did exactly. I'm on Linux CentOS 6.3.


That actually depends on what you did after that.

crontab - is interpreted as a variation on the crontab file invocation, where you change the current user's crontab with that contained in the specified file.

- in this case, as is common practice, means to read from stdin instead of an actual file.

The result of this is that if you pressed ctrl-c or otherwise aborted crontab nothing happened. On the other hand, if you pressed ctrl-d (essentially eof), ending the input normally, then the crontab was replaced by whatever you had entered previous to that (possibly emptying it if nothing had been entered).

  • I hit Ctrl+D so that explains why doing crontab -e resulted in a blank file :( oh well lesson learned, must use Ctrl+C instead. Jun 19 '14 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.