Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script that I want to be run every X minutes. I already have the cron sentence I need to paste to the cron, but can't find it anywhere.

The terminal command 'crontab -e' works, but it opens it in vim! No way I'm using that yet. How can I edit this file using gedit?

I don't even know the path to the file.

Here's the script:

*/3 * * * * /home/sergio/

How can I use gedit to manually add this line? Thanks!

share|improve this question
up vote 4 down vote accepted

You shouldn't edit the crontab file directly anyway, so you don't need to know the path to it. That said, you should be able to find the location on your system from man cron.

If you would rather use gedit than vim as your default editor, then add this to your ~/.profile:


In the short term (before logging out and back in), you can do as suggested above, i.e., from the command line:

EDITOR=gedit crontab -e
share|improve this answer
You should set EDITOR to a full path, as a few applications depend on that. Also set VISUAL to the same value (the two variables used to have a different meaning; nowadays most applications try both but a few only use one or the other). – Gilles Oct 23 '10 at 22:45

You can find out the path using:

`which crontab`

But you'd probably better off by setting your default editor. Try:

EDITOR=`which gedit` crontab -e
share|improve this answer
which crontab will display the path to the crontab program. I believe the OP was asking for the path to his crontab file. – garyjohn Oct 23 '10 at 17:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.