Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to run a program, and keep encountering a "Command not found" error.

I've checked that the appropriate directory is in $PATH, and that the file itself has execute permissions. I've tried running it in the directory using ./programname, but with no luck.

I'm running CentOS 6 with csh.

share|improve this question
    
What program are you talking about? –  Michael K Nov 15 '11 at 22:31
    
Console output would be helpful. –  Garrett Nov 15 '11 at 22:32
    
@MichaelK- The program is a pre-built executable, it's not a standard linux utility or anything –  dckrooney Nov 15 '11 at 22:35
    
@gman- The only output I receive is "programname: Command not found" –  dckrooney Nov 15 '11 at 22:35
    
What happens when you try to run it with /full/path/to/programname? What does your PATH look like? –  David Schwartz Nov 15 '11 at 22:40

2 Answers 2

up vote 1 down vote accepted

check "file ./programname" and "ldd ./programname" outputs. This is most probably compiled for some other platform or architecture than you run.

share|improve this answer
    
This is exactly what happened. I was inadvertently given a 32-bit binary; this led to a bit of an issue when trying to execute it on a 64-bit machine :) I wish the error was more descriptive than "Command not found", though... –  dckrooney Nov 17 '11 at 21:32

Try this

% ls -l /bin/date
-rwxr-xr-x 1 root root 58960 Jun 26  2008 /bin/date

% !!:2
/bin/date
Tue Nov 15 18:04:50 EST 2011

But replace /bin/date with your /full/path/to/programname

The !!:2 is a C shell history substitution !! means previous command. :2 means third word (they are numbered from 0)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.