I want to create a file, which will execute a code in terminal when dbl clicked.. Can this be done? If Yes, How?
Asked
Active
Viewed 168 times
1 Answers
-1
Yes, you will need to create a file ending with a .sh file extension. put #!/bin/bash on the first line by itself.
Then enter your terminal code.
You will need to right-click on the file, choose properties, go to the permissions tab, and check the box to allow executing the file.
You may need to open nautilus and go to edit > preferences > behavior and choose run executable text files when they are opened, or ask each time.
You can right-click on the file to make a link, and choose make link. Double-clicking on the file that is generated will execute the code.

contributor1
- 132
- 5
-
That is creating a script, not a launcher. – dobey Jul 01 '14 at 19:28
-
Added info at the bottom. – contributor1 Jul 01 '14 at 19:50
-
A symlink is also not a launcher. However, this question has already been marked a duplicate. – dobey Jul 01 '14 at 21:04
-
He never asked about a launcher. He wanted to create a file that would execute code. – contributor1 Jul 01 '14 at 21:30