LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to run executable files? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-run-executable-files-139554/)

Kelley 01-28-2004 07:26 AM

How to run executable files?
 
Can anyone teach this newbie how to open an executable file under Linux?? thanks!

jkobrien 01-28-2004 07:52 AM

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"?

320mb 01-28-2004 07:53 AM

Teach a Man to fish.................

http://www.ss64.com/bash/

kevinatkins 01-28-2004 07:54 AM

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

michaelk 01-28-2004 08:02 AM

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.

lugoteehalt 01-28-2004 09:56 AM

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?:)

rahulsivan 10-06-2007 04:40 AM

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

Nylex 10-06-2007 04:50 AM

Is the file actually called "Realplayer"? If not, use some common sense..

lugoteehalt 10-06-2007 08:15 AM

Quote:

Originally Posted by rahulsivan (Post 2915103)
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.

rahulsivan 10-10-2007 03:28 AM

Quote:

Originally Posted by lugoteehalt (Post 2915223)
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

chrism01 10-10-2007 07:24 AM

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

narutospree 12-07-2007 10:05 AM

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

masinick 12-07-2007 11:07 AM

Here is how to do it
 
Quote:

Originally Posted by rahulsivan (Post 2915103)
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.

fullTower 11-08-2009 04:12 PM

Thank you
 
You guys are awesome.

Thanks!

ColinTheBarbarian 12-31-2009 01:25 AM

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!


All times are GMT -5. The time now is 03:42 AM.