As a new Linux "superuser" trying to migrate from Windows 7 I have resisted asking basic questions that can be answered by searching, but I am stuck on this.
When I create an executable file from C with gcc in the Linux terminal, called say
hello.exe it is given
X permission. Then from the terminal I can run
./hello.exe no problem.
But when I try to run it from Caja it just shows its components as a text file. I can, however, select "Run as administrator" but then I have to enter my login password.
This is irrespective of which of these two settings is enabled:
- Run executable text files when they are opened.
- View executable text files when they are opened.
I leave it as the second setting though, otherwise I get asked what I want to do every time I view or edit a text file.
I have tried to launch Caja from the terminal with
sudo caja (needs password) but then, Caja won't run the executable at all because the Run option is no longer there.
How can I run an executable from Caja directly: with a double-click?
Edit: Can you run an executable from any file manager with a simple double-click?
Edit 2: Now running Mint Cinnamon with Nemo file manager but the question is basically the same. Am I missing some setting that allows an executable to be run directly?
During my research I found
GNOME Is Removing the Ability to Launch Binary Apps from Nautilus:
"Or, to put it another way, you won’t be able to double-click on programs, scripts or apps to launch them using Nautilus." (May 2018)
And as I suspect that the file manager authors develop them as derivatives of open source code (or perhaps use common system components), perhaps none of them now do.
I also found this Wikipedia page Comparison of file managers has various tables. The one called File features has the last column as "Run executable files" so I tried out several of those file managers.
- None of them would run an executable file which I have compiled (and some of them won't even allow easy access to my work drive – which is never the system drive).
But anyway, I have discovered an easy work-around for now, which is that my favourite text editor Geany will run an executable of the current source file, if it exists, from a single click or F5 keypress, without making it into a project.