Why some non-root program can be executed by double-click while others not?
For example, I found Firefox's process command line: /usr/lib/firefox/firefox. I browse to this location and double-click it, it prompts this:
enter image description here
However, if I type the command in terminal, it works normally.
executable
New contributor
add a comment |
For example, I found Firefox's process command line: /usr/lib/firefox/firefox. I browse to this location and double-click it, it prompts this:
enter image description here
However, if I type the command in terminal, it works normally.
executable
New contributor
add a comment |
For example, I found Firefox's process command line: /usr/lib/firefox/firefox. I browse to this location and double-click it, it prompts this:
enter image description here
However, if I type the command in terminal, it works normally.
executable
New contributor
For example, I found Firefox's process command line: /usr/lib/firefox/firefox. I browse to this location and double-click it, it prompts this:
enter image description here
However, if I type the command in terminal, it works normally.
executable
executable
New contributor
New contributor
New contributor
asked 1 hour ago
sz ppetersz ppeter
1
1
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop
or any other .desktop
file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.
And that's were /usr/lib/firefox/firefox
comes in. It is compiled as shared object.
$ file /usr/lib/firefox/firefox
/usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped
This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve()
call will pass the path to that file) recognizes that as executable file just fine.
Now, what gets executed when you execute firefox.desktop
? That's /usr/bin/firefox.sh
- a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox
later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120772%2fwhy-some-non-root-program-can-be-executed-by-double-click-while-others-not%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop
or any other .desktop
file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.
And that's were /usr/lib/firefox/firefox
comes in. It is compiled as shared object.
$ file /usr/lib/firefox/firefox
/usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped
This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve()
call will pass the path to that file) recognizes that as executable file just fine.
Now, what gets executed when you execute firefox.desktop
? That's /usr/bin/firefox.sh
- a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox
later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.
add a comment |
Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop
or any other .desktop
file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.
And that's were /usr/lib/firefox/firefox
comes in. It is compiled as shared object.
$ file /usr/lib/firefox/firefox
/usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped
This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve()
call will pass the path to that file) recognizes that as executable file just fine.
Now, what gets executed when you execute firefox.desktop
? That's /usr/bin/firefox.sh
- a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox
later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.
add a comment |
Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop
or any other .desktop
file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.
And that's were /usr/lib/firefox/firefox
comes in. It is compiled as shared object.
$ file /usr/lib/firefox/firefox
/usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped
This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve()
call will pass the path to that file) recognizes that as executable file just fine.
Now, what gets executed when you execute firefox.desktop
? That's /usr/bin/firefox.sh
- a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox
later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.
Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop
or any other .desktop
file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.
And that's were /usr/lib/firefox/firefox
comes in. It is compiled as shared object.
$ file /usr/lib/firefox/firefox
/usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped
This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve()
call will pass the path to that file) recognizes that as executable file just fine.
Now, what gets executed when you execute firefox.desktop
? That's /usr/bin/firefox.sh
- a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox
later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.
answered 1 hour ago
Sergiy KolodyazhnyySergiy Kolodyazhnyy
72.9k9152316
72.9k9152316
add a comment |
add a comment |
sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.
sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.
sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.
sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120772%2fwhy-some-non-root-program-can-be-executed-by-double-click-while-others-not%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown