I would like to create a file, which could be saved in the Desktop or in another folder, which upon a user double click on it executes some commands, one of which should be as super user (sudo) and which executes another file.

An example of the commands I would like to execute could be this one:

cd Desktop/TargetFolder
sudo ./FileToExecute

Thank you very much!


1 Answer 1


Creating an .sh (same as .exe in Windows) file would do. You can make it executable by this command: chmod +x nameofscript.sh

You may have a look at this one as well which elaborates a bit more.

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.