LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-28-2004, 07:26 AM   #1
Kelley
LQ Newbie
 
Registered: Jan 2004
Posts: 4

Rep: Reputation: 0
How to run executable files?


Can anyone teach this newbie how to open an executable file under Linux?? thanks!
 
Old 01-28-2004, 07:52 AM   #2
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
From the command prompt type /path/to/executable/name_of_prog.

If you are in the same directory as the executable then "/path/to/executable/" above equates to "./"

Check that it is executable with ls -l, you should see a string like "-rwxr-xr-x", where the three x's mean permission for the owner, group and others to execute the file.

If you're missing an x, the command chmod ugo+x will give all the above permission (check the manpage 'man chmod' for more on this).

If the executable still appears to be doing nothing, then it depends on what it is and you'd have to post more information.

John

p.s. unless by "open" you meant "look at"?
 
Old 01-28-2004, 07:53 AM   #3
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Teach a Man to fish.................

http://www.ss64.com/bash/
 
Old 01-28-2004, 07:54 AM   #4
kevinatkins
Member
 
Registered: Jan 2004
Location: cheshire, uk
Distribution: Ubuntu Hoary
Posts: 605

Rep: Reputation: 33
under gui (eg, kde or gnome, etc), you should be able to just click on the file.

from within the console (command prompt), an example is best -
assume you want to run a file called program1 in directory /usr/bin.
you can either simply type /usr/bin/program1 at the command prompt, or you can navigate to the directory and type program1 or, if the directory isn't in your $PATH environment variable, you might need to type ./program1.
hope this helps
 
1 members found this post helpful.
Old 01-28-2004, 08:02 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,730

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Welcome to LinuxQuestions.

You will find many answers to your questions faster by searching this website or the web. It can be difficult because as a newbie you might not know what to search for.

What program(s) are you trying to execute?

What makes a linux file executable is its permissions. linux does not care what a file is named or its extension. You can change a files permissions using the chmod console command. Permissions also determines who can read / write / execute. Some files can only be executed if logged in as root.

linux path environment is different then windows. linux only searchs the path not the current working directory for the file. To execute a program in the current work directory use in a console windows use.
./<file_name>

For all other files use the full path.
 
Old 01-28-2004, 09:56 AM   #6
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Vaughly about executing files:

lugo~$ cat file.txt
echo 'filth'
lugo~$ bash file.txt
filth

How to pass arguments to a script:

lugo~$ cat file.txt
echo 'filth' $1 $2
lugo~$ bash file.txt covers all
filth covers all

Bash adds an argument of its own '$0':

lugo~$ cat file.txt
echo $0 'says filth' $1 $2
lugo~$ bash file.txt covers all
file.txt says filth covers all

No need to put 'bash' if put #!/bin/bash at top of file:

lugo~$ cat file.txt
#!/bin/bash
echo $0 'says filth' $1 $2
lugo~$ file.txt
permission denied
lugo~$ chmod a+x file.txt
lugo~$ file.txt
file.txt says filth covers all

For another language put, say, #!/usr/bin/python, if that's where python is.

Wonder if I've got anything to do?
 
Old 10-06-2007, 04:40 AM   #7
rahulsivan
LQ Newbie
 
Registered: Oct 2007
Posts: 2

Rep: Reputation: 0
slill not able to run the executable file

i am still not able to run executable file
I am trying to install the Real player on my PC. I had downloaded the .bin file to my home. But when I type ./Realplayer answer comes as No such file or directory. I am using Ubuntu linux ,its version for 64 bit pc's
 
Old 10-06-2007, 04:50 AM   #8
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Is the file actually called "Realplayer"? If not, use some common sense..
 
Old 10-06-2007, 08:15 AM   #9
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Quote:
Originally Posted by rahulsivan View Post
i am still not able to run executable file
I am trying to install the Real player on my PC. I had downloaded the .bin file to my home. But when I type ./Realplayer answer comes as No such file or directory. I am using Ubuntu linux ,its version for 64 bit pc's
Don't quite understand.

If there's a file in /home/george/, i.e. your home directory, called Realplayer.bin then that might explain it. 'No such file or directory.' because you didn't put .bin on the end. If it's a windows file it won't run without wine or something like that.

Doesn't Ubuntu have something to click, xmms or whatever? Otherwise install realplayer or something like using an instalation program - again there's one in Ubuntu's menu I think.
 
Old 10-10-2007, 03:28 AM   #10
rahulsivan
LQ Newbie
 
Registered: Oct 2007
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by lugoteehalt View Post
Don't quite understand.

If there's a file in /home/george/, i.e. your home directory, called Realplayer.bin then that might explain it. 'No such file or directory.' because you didn't put .bin on the end. If it's a windows file it won't run without wine or something like that.

Doesn't Ubuntu have something to click, xmms or whatever? Otherwise install realplayer or something like using an instalation program - again there's one in Ubuntu's menu I think.
Thanks for reply,
I had put .bin at the end. Sorry for missing it on the text. Actually I have problem with every executable files which I try to install from external sources. I just mentioned one.
I have to install a software named GrADS which is a Data Plotting software used for Meteorological purposes. I put the folder grads in my home, edited my .bashrc file and typed gradsc at the command line .Result was
bash: /home/rahul/grads/bin/gradsc: No such file or directory
the file is the on the path location, same as in the case of realplayer
 
Old 10-10-2007, 07:24 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Pick one example eg the GrADS prog and do the following:

1. cd into the dir where the program file is/are
2. use the cmd
ls -l
and show us the results.
3. use the cmd
pwd
and show results
4. use cmd
whoami
and show results

in re your last comment, note that Linux (and Unix generally) is case-sensitive ie GrADS is != grads
 
Old 12-07-2007, 10:05 AM   #12
narutospree
LQ Newbie
 
Registered: Dec 2007
Posts: 1

Rep: Reputation: 0
i think what kelly is trying to ask is how to run .exe files
inorder for ya to do that you have to download wine from ... i'll get back to ya on that
 
Old 12-07-2007, 11:07 AM   #13
masinick
Member
 
Registered: Apr 2002
Location: Greenville, SC
Distribution: Debian, antiX, MX Linux
Posts: 636
Blog Entries: 16

Rep: Reputation: 104Reputation: 104
Here is how to do it

Quote:
Originally Posted by rahulsivan View Post
i am still not able to run executable file
I am trying to install the Real player on my PC. I had downloaded the .bin file to my home. But when I type ./Realplayer answer comes as No such file or directory. I am using Ubuntu linux, its version for 64 bit pc's

The Realplayer file that typically gets downloaded often comes as a Realplayer.bin file or something very similar. First, make sure you are in the directory containing the file. You may have downloaded it to your desktop, so from your home directory, it is possible that you have to change to that directory, for example,
Code:
cd Desktop
Next, you want to make that file executable because it typically contains a script that installs the player and its libraries elsewhere on your system. Therefore, to make the file executable, type
Code:
chmod +x Realplayer.bin
or replace that with the actual name of the file.

Now it will be possible to run that file. Chances are, the system will want to install this file in some system writable directory, so to account for that likelihood, become the root user.

Code:
su
Password:
Code:
<type-your-root-password-here>
Now you ought to be able to run the script and get it installed in an appropriate place:

#
Code:
./Realplayer
#
Code:
./Realplayer.bin
or whatever the program is called, then follow the instructions to install it as desired.
 
1 members found this post helpful.
Old 11-08-2009, 04:12 PM   #14
fullTower
LQ Newbie
 
Registered: Nov 2009
Posts: 1

Rep: Reputation: 0
Thank you

You guys are awesome.

Thanks!
 
Old 12-31-2009, 01:25 AM   #15
ColinTheBarbarian
LQ Newbie
 
Registered: Dec 2009
Posts: 5

Rep: Reputation: 0
Question How to Run Full Tilt Poker?

Aloha All! I followed your steps masinick and got the FullTiltSetup.exe to run (I guess through WINE) and it worked great to run the .exe; however, I don't know where the file installed to from inputing 'C:\Home\Colin\FullTilt' as the location. Any ideas on where to look or how to install it to a place where I can find it? Mahalo!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
an executable that does not run jgoggel Programming 2 07-22-2004 07:54 PM
Cant't run executable files on Mandrake 9.1 alex101 Mandriva 4 10-14-2003 10:36 AM
run executable files ZeRo69er Linux - Software 4 08-07-2003 02:26 AM
Converting perl files to executable mac files mrozkan Programming 0 04-16-2002 09:56 AM
How do I run my executable?? scott7500 Programming 2 12-30-2001 04:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration