LinuxQuestions.org
Register a domain and help support LQ
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 10-19-2012, 09:10 PM   #1
unixor
Member
 
Registered: Aug 2012
Posts: 46

Rep: Reputation: Disabled
cannot run executable


hello!

I cd to a dir, where an executable exists (green characters in bash)

I type ./the_name_of_the_executable and I get:

bash: no such file or dir

what is wrong?

thanks!
 
Old 10-19-2012, 09:18 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,340
Blog Entries: 12

Rep: Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730
What is the name of the executable and have you tried it without the "./"?
 
Old 10-19-2012, 09:20 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
forget the green---what are the permissions on the file? (post the output of "ls -l")
 
Old 10-19-2012, 09:44 PM   #4
unixor
Member
 
Registered: Aug 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
I have also tried it with ./

the permissions are -rwxr-xr-x
 
Old 10-20-2012, 01:32 AM   #5
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by unixor View Post
hello!

I cd to a dir, where an executable exists (green characters in bash)

I type ./the_name_of_the_executable and I get:

bash: no such file or dir

what is wrong?

thanks!
Surprizing!! Did you check the file existance, as follow?
Code:
ls -la <executable-file-name>
If it exists, and is a shell script, then it must run with ./<executable-file-name> command, else you can run it with:
Code:
sh <executable-file-name>
But I think you're making some mistake while entering filename or mis-spelling it. So after you type ./ simply type first 1 or 2 characters of filename and press TAB key from keyboard. It will take the correct filename.

Last edited by shivaa; 10-20-2012 at 01:37 AM.
 
Old 10-20-2012, 02:01 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
can you try the command:
file <your executable>
probably it is not a binary but a script and the shebang (the very first line of the script) points to an invalid interpreter.
It should look like:
#!<some app>
does this <some app> exist?
 
Old 10-21-2012, 08:33 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Show the entire output from ls -l, it could be ownerships rather than perms; the net effect is the same.
 
Old 10-21-2012, 08:49 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Please show us also the output of
Code:
uname -a
file /path/to/file
This can also be an issue of trying to start a 32 bit executable on a 64 bit OS.

@ALL: The code-tags are there for a reason, please use them.
 
Old 10-23-2012, 05:20 AM   #9
unixor
Member
 
Registered: Aug 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
Please show us also the output of
Code:
uname -a
file /path/to/file
This can also be an issue of trying to start a 32 bit executable on a 64 bit OS.
Code:
user2@server02:~/Practic$ uname -a
Linux server02 3.2.0-30-generic #48-Ubuntu SMP Fri Aug 24 16:52:48 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

user2@server02:~/Practic$ file /home/user2/Practic/chamm
/home/user2/Practic/chamm: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped
user2@server02:~/Practic$
 
Old 10-23-2012, 07:17 AM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
You are trying to run a 32 bit executable in a 64 bit OS. You need compatibility libraries to do something like that. Install the package ia32-libs and try it again.
 
  


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
cannot get an executable to run... disruptive Linux - Newbie 5 03-04-2008 12:18 PM
an executable that does not run jgoggel Programming 2 07-22-2004 08:54 PM
How to run programs using executable name ravykanth Linux - Newbie 1 10-06-2003 12:45 AM
run executable files ZeRo69er Linux - Software 4 08-07-2003 03:26 AM
How do I run my executable?? scott7500 Programming 2 12-30-2001 05:22 PM


All times are GMT -5. The time now is 10:55 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