Quote:
Originally Posted by yanom Then why do the binaries in /usr/share/ not have any file extension at all? |
asymptote was partially correct in what he said but missed out that a binary file isn't just one with a .bin extension, it is any compiled program, be it executable or library. File extensions don't mean much in Linux or the Unix world in general. They are not required as all files have a header that explains what it is.
Binaries are executed by the operating system directly. I suspect you are asking because you are unsure how to execute one outside of the usual locations? You need to grant a file execution permissions explicitly using something like
chmod +x <filename> or using permission codes
to grant permissions to all. Once that is done either put the file within your path (somewhere like /usr/bin/ - you can look at your path by running
echo $PATH) or to execute it in place you can either specify the full path to the file or cd to it and call it from within that directory. The latter is the better of the two.
Code:
/home/username/file
cd /home/username/
./file