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.

1 Answer 1


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. Commented Jun 19, 2014 at 20:47

You must log in to answer this question.

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