LinuxQuestions.org
Help answer threads with 0 replies.
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 05-27-2011, 04:49 AM   #1
New123
LQ Newbie
 
Registered: May 2011
Posts: 9

Rep: Reputation: Disabled
Lightbulb 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
 
Old 05-27-2011, 04:54 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
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
in the directory where you saved the files.

Kind regards,

Eric
 
Old 05-27-2011, 04:56 AM   #3
jrecortel
Member
 
Registered: Sep 2008
Location: Philippines
Distribution: slackware
Posts: 123

Rep: Reputation: 19
try
Code:
./program_name
Just Make sure it has execute permission.
 
Old 05-27-2011, 05:02 AM   #4
New123
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by EricTRA View Post
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
in the directory where you saved the files.

Kind regards,

Eric
Hi there!

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
 
Old 05-27-2011, 05:29 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
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
 
Old 05-27-2011, 09:08 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,350
Blog Entries: 12

Rep: Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731
"./" 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.
 
Old 05-30-2011, 05:50 AM   #7
New123
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
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
 
Old 05-30-2011, 05:58 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Quote:
As I understand I should now be able to type in the executable name, which is xfst


You should not type 'xfst' , but ./xfst
 
Old 05-30-2011, 06:03 AM   #9
New123
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanx! Will try that!
New123
 
Old 05-30-2011, 06:09 AM   #10
New123
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Hi again!

Have tried ./xfst - still the same error message!
New123
 
Old 05-30-2011, 06:14 AM   #11
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

What file are you trying to execute? Type the following and post output please:
Code:
file xfst
Kind regards,

Eric
 
Old 05-30-2011, 06:40 AM   #12
New123
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
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
 
Old 05-30-2011, 06:49 AM   #13
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Thanks for the feedback. Can you confirm you're running a 32-bit OS? Execute:
Code:
uname -a
and post output please.

Kind regards,

Eric
 
Old 05-30-2011, 07:04 AM   #14
New123
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
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:~$
 
Old 05-30-2011, 07:12 AM   #15
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

It looks like you're running a 64-bit kernel:
Code:
x86_64 GNU/Linux
and you're trying to execute a 32-bit application
Code:
xfst: ELF 32-bit LSB executable
Do you have a 64-bit version of that application available? If so, then remove the 32-bit and install the correct version for your platform. If not, you could try installing the ia32 libraries which might work also.

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
bash - difference between executing program in for loop and typing each command? jlarsen Programming 14 11-10-2008 06:38 PM
Command for executing C program in crontab bhandu Linux - Newbie 1 07-14-2007 01:54 PM
Know of a command executing program for LIRC? Titan2k Linux - Software 2 04-07-2007 09:11 PM
typing a program name in the command prompt to run it iammeuno Linux - Newbie 1 12-19-2003 02:11 PM
how do I make a program executable through the command prompt? iammeuno Linux - Software 1 12-18-2003 04:29 PM


All times are GMT -5. The time now is 11:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration