Find the answer to your Linux question:
Results 1 to 6 of 6
I'm just curious - how exactly does my system run binaries? Is there some program that does this?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Location
    At my computer
    Posts
    39

    Question What runs binaries?


    I'm just curious - how exactly does my system run binaries? Is there some program that does this?

  2. #2
    Just Joined!
    Join Date
    Mar 2008
    Location
    At my computer
    Posts
    39
    Then why do the binaries in /usr/share/ not have any file extension at all?

  3. #3
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133
    Quote Originally Posted by yanom View Post
    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
    Code:
    chmod +755
    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

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Mar 2008
    Location
    At my computer
    Posts
    39
    is there any way to add a directory to my $PATH?

  6. #5
    Just Joined!
    Join Date
    Mar 2008
    Location
    At my computer
    Posts
    39
    Binaries are executed by the operating system directly
    So you mean that the binaries are executed by the GNU/Linux kernel?

  7. #6
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Quote Originally Posted by yanom View Post
    is there any way to add a directory to my $PATH?
    Code:
    export PATH=$PATH:/new/dir/path
    To add it permanently, put it in your login profile.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •