Ubuntu – sudo bash can’t execute script

bashcommand linescripts

I try to run a shell script file but failed so far on Ubuntu.

In my terminal:

~/Desktop/FTL/data$ ls
amd64  exe_icon.bmp  FTL  licenses  resources  x86
~/Desktop/FTL/data$ sudo bash ./FTL.sh
[sudo] password for anon: 
bash: ./FTL.sh: No such file or directory
~/Desktop/FTL/data$ sh FTL.sh
sh: 0: Can't open FTL.sh
~/Desktop/FTL/data$ 

Best Answer

Well, as can be deduced from the output of ls command, the name of the file is FTL, not FTL.sh. So you should use:

sudo bash ./FTL

or

 sh ./FTL

or maybe only:

./FTL

Also be sure that the file is executable, by running:

chmod +x FTL