Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Possible Duplicate:
How do I run .sh files in Terminal?

I'm trying to install Craftbukkit on my Ubuntu 12.04 server. However, I'm having issues with step seven, which instructs me to run ./

If I run it as a normal user, then I get a permissions error. If I run it using sudo, then I get sudo: ./ command not found.

What am I doing wrong?

share|improve this question

marked as duplicate by Eliah Kagan, jokerdino, Mitch, devav2, Tom Brossman Oct 7 '12 at 11:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

You need to chmod the file 1st before run.

chmod +x

Now your can run your .sh file as follows


Another way to run .sh file in Linux



share|improve this answer
It was already executable. – SomeKittens Jun 19 '12 at 18:21

According to the wiki page of bukkit.

[...] type sh to execute the script you wrote before. Your server will start and keep running until you stop it (or until it crashes).

share|improve this answer
Thanks, this helped me find the issue (Java wasn't installed. Duh....) – SomeKittens Jun 19 '12 at 18:20
Passing an explicit shell instead of letting the system infer the right script form the shebang might lead to errors. It*s just a matter of luck that it worked here. – user unknown Jun 19 '12 at 19:10
@userunknown: Well these are the contents of #!/bin/sh screen java -Xms1024M -Xmx1024M -jar craftbukkit.jar – pl1nk Jun 19 '12 at 19:44
I told you, that it might be a matter of luck, if it works. Why don't you use sudo ./ – user unknown Jun 19 '12 at 20:55
@userunknown You have to chmod +x ./ first, in this situation.. – Eliah Kagan Jun 19 '12 at 21:05

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