Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have an executable file but don't know what type or format it is. When I execute like this

$chmod +x xfile
$./xfile

It shows

Permission denied

when I run as super user

$sudo ./xfile

It shows

sudo: ./xfile: command not found

I am new to Linux please tell me how to execute it.

share|improve this question
    
Try sudo sh /path/to/file/xfile –  blade19899 Sep 18 '12 at 13:17
    
which type of executable is it? A python program, ruby or some binary ? –  Pranit Bauva Sep 18 '12 at 14:05
    
You are doing the right process to run the file. Nevertheless, in certain cases you must use sudo chmod -x xfile in order to create the proper execution permissions over the file itself. In addition you must consider the location of the file. If it belongs to a different hard disk drive/partition or usb-memory/external-storage the command may not succed giving the proper permissions to the file for execution. Good luck! –  Geppettvs D'Constanzo Sep 18 '12 at 15:15
    
Once I was in trouble because I forgot the extension of the file. Did you put it? –  Michele Sep 23 '12 at 14:47
add comment

1 Answer

Strange, it works exactly that way over here.

First, try to find out what the file is:

file xfile

The file command looks inside the file and based on certain "magic" tries to figure out what that program does.

From what you describe I guess that it is a shell executable that tries to execute yet another program. If this is the case, why don't you post the code of the shell executable using http://paste.ubuntu.com.

share|improve this answer
add comment

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.