Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Misc
Reload this Page What runs binaries?
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Misc Any questions or Linux discussion that does not fit in any of the other technical areas.

Reply
 
Thread Tools Display Modes
Old 05-26-2008   #1 (permalink)
Just Joined!
 
Join Date: Mar 2008
Location: At my computer
Posts: 36
Question What runs binaries?

I'm just curious - how exactly does my system run binaries? Is there some program that does this?
yanom is offline   Reply With Quote
Old 05-26-2008   #2 (permalink)
Just Joined!
 
Join Date: Mar 2008
Location: At my computer
Posts: 36
Then why do the binaries in /usr/share/ not have any file extension at all?
yanom is offline   Reply With Quote
Old 05-26-2008   #3 (permalink)
Bigtomrodinator
 
bigtomrodney's Avatar
 
Join Date: Nov 2004
Location: Sunny South-East of Ireland
Posts: 5,176
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
__________________
In the land of the blind, the night vision users are laughing at the king

Registered Linux user #378740

New members read here / Forum Rules
bigtomrodney is offline   Reply With Quote
Old 05-27-2008   #4 (permalink)
Just Joined!
 
Join Date: Mar 2008
Location: At my computer
Posts: 36
is there any way to add a directory to my $PATH?
yanom is offline   Reply With Quote
Old 05-27-2008   #5 (permalink)
Just Joined!
 
Join Date: Mar 2008
Location: At my computer
Posts: 36
Quote:
Binaries are executed by the operating system directly
So you mean that the binaries are executed by the GNU/Linux kernel?
yanom is offline   Reply With Quote
Old 05-31-2008   #6 (permalink)
scm
Linux Engineer
 
Join Date: Feb 2005
Posts: 1,003
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.
scm is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 04:47 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0