executing a program from command prompt
I'm very new to Linux. I'm trying to run an application from the command prompt. I've set the path in .bashrc. My executable file and all other files needed by it are saved in the same directory as the path. When I enter the executable name to run it, I get an error message saying that the command is not found.
What else do I need to set or check? New123 |
Hello and Welcome to LinuxQuestions,
Can you post the command you are trying to execute so that we know what you've tried and give you a dedicated answer? Did you set the permissions on the file you want to run? Check permissions with Code:
ls -l Kind regards, Eric |
try
Code:
./program_name |
Quote:
It is not a command that I'm trying to run, it is an executable file. Unfortunately I don't have my laptop with me. I'll give more details when I get home. Thanx for the quick response! New123 |
Hi,
If you're referring to a Windows executable file, then you'll need Wine to run it. Windows executable files are not going to execute natively on Linux. Looking forward to your feedback. Post the exact command line as you tried please. Kind regards, Eric |
"./" means "run a program in the current directory." "." means "the directory I'm in right now" (more properly termed the "working directory").
If you want to run /usr/bin/foo and /usr/bin is in your path, it should be enough just to enter "foo" on the command line. If you cd to /usr/bin, then you might need to enter "./foo" or it may be enough to enter "foo." I can run "gedit" (the Gnome editor) from a terminal simply by entering "gedit." As EricTRA pointed out, the program must be a *nix executable. |
Hi there,
The file that I'm trying to run, is a Linux executable file. When I look at its properties, it shows me that it is an executable. It is an executable that is part of a Linux package used for finite state machines. The executable and all the files that it is using is in /home/drinaduplessis/newxfst. I change my directory from the command prompt to this, and doing ls -l, shows that I am in the correct directory. As I understand I should now be able to type in the executable name, which is xfst. If I do I get a message saying 'no such file or directory'. Before I changed the permission of the file to read and write, I got a message saying something like 'command invalid' or something to that effect. I can run a PERL program from the directory without a problem. What else do I need to check? Regards New123 |
Quote:
You should not type 'xfst' , but ./xfst |
Thanx! Will try that!
New123 |
Hi again!
Have tried ./xfst - still the same error message! New123 |
Hello,
What file are you trying to execute? Type the following and post output please: Code:
file xfst Eric |
This is what I get after entering file xfst.
drinaduplessis@drinaduplessis-laptop:~$ cd /home/drinaduplessis/newxfst drinaduplessis@drinaduplessis-laptop:~/newxfst$ file xfst xfst: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped drinaduplessis@drinaduplessis-laptop:~/newxfst$ When xfst is executed it should allow me to run script files with xfst commands. New123 |
Hi,
Thanks for the feedback. Can you confirm you're running a 32-bit OS? Execute: Code:
uname -a Kind regards, Eric |
This is the output:
drinaduplessis@drinaduplessis-laptop:~$ uname -a Linux drinaduplessis-laptop 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:09:38 UTC 2010 x86_64 GNU/Linux drinaduplessis@drinaduplessis-laptop:~$ |
Hi,
It looks like you're running a 64-bit kernel: Code:
x86_64 GNU/Linux Code:
xfst: ELF 32-bit LSB executable Kind regards, Eric |
All times are GMT -5. The time now is 10:46 AM. |