Originally Posted by
benjaminbreeg
Thank you! I imagine I could re-phrase my question by specifying the type of file that I am looking for, along the lines of: "list of all applications, plus the location of the main executable," though I am guessing that you'd reply that it is not clear what I mean by "main executable."
Actually, that is perfectly clear, but things are so simple. In Unix, we often have a compiled binary and a startup script. Both are the "main executable", since the startup script sets environment variables needed for the binary program to run successfully.
Let's use firefox. Suppose you've avoided using the snap version, which you should for many reasons. Anyways, to find the program, we can use
Code:
$ which firefox
/usr/bin/firefox
Seems simple, right? but /usr/bin/firefox isn't really the program. It is a script. See
Code:
$ file /usr/bin/firefox
/usr/bin/firefox: symbolic link to ../lib/firefox/firefox.sh
So we need to check out
Code:
$ file /usr/lib/firefox/firefox.sh
/usr/lib/firefox/firefox.sh: POSIX shell script, ASCII text executable
Ah ... a shell script, as predicted above. If we look at that script ... way down at the bottom we see:
Code:
exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"
That's the binary file ... see:
Code:
$ 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]=176a7faada6ae3fd57f9d260e6cf8cf8480a93af, stripped
Just to show the vast difference in file size:
Code:
$ ls -lF /usr/lib/firefox/firefox*
-rwxr-xr-x 1 root root 777624 Aug 19 01:23 /usr/lib/firefox/firefox*
-rwxr-xr-x 1 root root 2667 Aug 19 01:23 /usr/lib/firefox/firefox.sh*
750KB for the binary. 2.5KB for the script.
Which is the main executable? In the menu, it will be the symbolic link to the script.
Bookmarks