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.

migrated from serverfault.com Apr 7 '14 at 4:46

This question came from our site for system and network administrators.

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. – user2344668 Jun 19 '14 at 20:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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