script shortcut to open two files in gedit as sudo

Posted by Sam on Ask Ubuntu See other posts from Ask Ubuntu or by Sam
Published on 2014-08-24T08:47:44Z Indexed on 2014/08/24 10:30 UTC
Read the original article Hit count: 243

Filed under:
|
|

I want to double click a file on my desktop, and have two files be opened in gedit as sudo.

Whenever I'm making a new website, I need to open

/etc/hosts /etc/apache2/sites-enabled/000-default.conf

as sudo.

At the moment this means opening the terminal, runing sudo gedit then opening each file manually. I want to streamline this part of my workflow. On windows I had wrote a little bash script which worked nicely. How can I do the same in ubuntu?

So far in my searches I've come across ways of adding a shortcut to the file browser, and similar things, but not exactly what I want.

I have tried creating a desktop launcher, but can't see how to make it run as sudo.

© Ask Ubuntu or respective owner

Related posts about launcher

Related posts about sudo