Ubuntu – How to execute a executable with sudo

12.04command linesudo

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.

Best 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.

Related Question