We should type ./file.sh in terminal to run sh. Is there way to run it as executable file by double click ?
Asked
Active
Viewed 5,248 times
-2
-
1Still a dupe. One of the answers there is specifically for xfce. – muru Jul 01 '18 at 22:50
2 Answers
6
Note: The question was edited to add "Xubuntu" after this answer was posted. This answer refers to plain Ubuntu Desktop 18.04.
You did not tell us, so I assume that you are running Ubuntu Desktop 18.04. By default, the file manager will not allow running scripts by double clicking them. To change this behavior:
Open the file manager.
Click on the "Files" label on the top-left of the screen. A menu will drop down.
Click "Preferences". A tabbed dialog box will be displayed.
Select the "Behavior" tab.
Choose your preferred behavior for "executable text files" aka scripts.

AlexP
- 10,197
-
-
-
you'd better use it, GNOME 3 eats a lot and gives nothing in return for that. Thanks anyway. – R S Jul 01 '18 at 20:47
0
You need to right click on it and tick the box permitting it to be an executable. Then you can simply double click, you will get a pop up asking whether to execute it or not.

Rattle
- 175
-
I don't have such, in file properties it's marked "allow file run as program". I think it has all necessary permissions: -rwxr-xr-x 1 user user 6844 Jun 12 16:48 idea.sh – R S Jul 01 '18 at 17:20
-